From c9c48db2f2672bb36a1ccb8b92ba5cce8bf533e5 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 5 Mar 2022 11:07:32 +0800 Subject: [PATCH] fix: work on ipv6 host --- args.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/args.go b/args.go index 5ad0ec6..98fce9b 100644 --- a/args.go +++ b/args.go @@ -77,6 +77,12 @@ func parseEnv() (opts Args, err error) { if len(ss_local_host) == 0 { return } + if strings.IndexByte(ss_remote_host, ':') != -1 { + ss_remote_host = "[" + ss_remote_host + "]" + } + if strings.IndexByte(ss_local_host, ':') != -1 { + ss_local_host = "[" + ss_local_host + "]" + } opts.Add("remoteAddr", ss_remote_host) opts.Add("remotePort", ss_remote_port)