From 32321a7c5f7c2c4763addb5e75e05cfa8030944c Mon Sep 17 00:00:00 2001 From: NNdroid <99177648+NNdroid@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:15:24 +0800 Subject: [PATCH] fix a bug. --- common/netutil/netutil.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/netutil/netutil.go b/common/netutil/netutil.go index eb0a087..0255633 100644 --- a/common/netutil/netutil.go +++ b/common/netutil/netutil.go @@ -23,7 +23,9 @@ func ConnectServer(config config.Config) net.Conn { host := config.ServerAddr if config.Protocol == "wss" { scheme = "wss" - host = config.TLSSni + if config.TLSSni != "" { + host = config.TLSSni + } } u := url.URL{Scheme: scheme, Host: host, Path: config.WebSocketPath} header := make(http.Header)