Skip to content

Commit

Permalink
Possibility to add IPv6 as a parameter for http server (#450)
Browse files Browse the repository at this point in the history
* make it possible to pass IPv6 parameters for the host

Signed-off-by: dnazaruk <[email protected]>
  • Loading branch information
ndimitry authored and brian-brazil committed Nov 26, 2019
1 parent 55ee16f commit 38f135e
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ public static void main(String[] args) throws Exception {
System.exit(1);
}

String[] hostnamePort = args[0].split(":");
int port;
InetSocketAddress socket;

if (hostnamePort.length == 2) {
port = Integer.parseInt(hostnamePort[1]);
socket = new InetSocketAddress(hostnamePort[0], port);
} else {
port = Integer.parseInt(hostnamePort[0]);
int colonIndex = args[0].lastIndexOf(':');

if (colonIndex < 0) {
int port = Integer.parseInt(args[0]);
socket = new InetSocketAddress(port);
} else {
int port = Integer.parseInt(args[0].substring(colonIndex + 1));
String host = args[0].substring(0, colonIndex);
socket = new InetSocketAddress(host, port);
}

new BuildInfoCollector().register();
Expand Down

0 comments on commit 38f135e

Please sign in to comment.