summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/ip/hproxy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/cmd/ip/hproxy.c b/sys/src/cmd/ip/hproxy.c
index d1c355bfc..5b50a8d28 100644
--- a/sys/src/cmd/ip/hproxy.c
+++ b/sys/src/cmd/ip/hproxy.c
@@ -51,14 +51,17 @@ main(void)
*p++ = 0;
path = p;
}
- if(*host == '[')
+ if(*host == '['){
host++;
- if(p = strrchr(host, ':')){
+ if(p = strrchr(host, ']')){
+ *p++ = 0;
+ if(p = strrchr(p, ':'))
+ port = ++p;
+ }
+ } else if(p = strrchr(host, ':')){
*p++ = 0;
port = p;
}
- if(p = strrchr(host, ']'))
- *p = 0;
snprint(addr, sizeof(addr), "tcp!%s!%s", host, port);