summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.c b/main.c
index f88506c..ce51db9 100644
--- a/main.c
+++ b/main.c
@@ -103,6 +103,7 @@ static int add_listener_arg(char *arg, bool tls)
char *host = NULL;
char *port = arg;
char *s;
+ int l;
s = strrchr(arg, ':');
if (s) {
@@ -111,6 +112,14 @@ static int add_listener_arg(char *arg, bool tls)
*s = 0;
}
+ if (host && *host == '[') {
+ l = strlen(host);
+ if (l >= 2) {
+ host[l-1] = 0;
+ host++;
+ }
+ }
+
return uh_socket_bind(host, port, tls);
}