From f75d94817a4a3149bab1439ea5b872e68e29918c Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 8 Jan 2017 16:01:28 +0100 Subject: [PATCH] fix #356 --- transport/internet/websocket/dialer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transport/internet/websocket/dialer.go b/transport/internet/websocket/dialer.go index 2caf2069..1c129f24 100644 --- a/transport/internet/websocket/dialer.go +++ b/transport/internet/websocket/dialer.go @@ -86,7 +86,11 @@ func wsDial(src v2net.Address, dest v2net.Destination, options internet.DialerOp } } - uri := protocol + "://" + dest.NetAddr() + "/" + wsSettings.Path + host := dest.NetAddr() + if (protocol == "ws" && dest.Port == 80) || (protocol == "wss" && dest.Port == 443) { + host = dest.Address.String() + } + uri := protocol + "://" + host + "/" + wsSettings.Path conn, resp, err := dialer.Dial(uri, nil) if err != nil {