Darien Raymond 8 年之前
父节点
当前提交
f75d94817a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      transport/internet/websocket/dialer.go

+ 5 - 1
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 {