// explicit port name/number) means listen on
// the well-known port for the specified
// protocol, "foo.example:https".
- listenAddr = net.JoinHostPort(listenAddr, listenURL.Scheme)
+ port := listenURL.Scheme
+ if port == "ws" || port == "wss" {
+ port = "http" + port[2:]
+ }
+ listenAddr = net.JoinHostPort(listenAddr, port)
}
listener, err := net.Listen("tcp", listenAddr)
if err == nil {
},
{ // implicit port 80 in InternalURLs
internalURLs: map[string]string{"http://localhost/": ""},
- expectListen: "http://localhost/",
- expectInternal: "http://localhost/",
expectErrorMatch: `.*:80: bind: permission denied`,
},
{ // implicit port 443 in InternalURLs
expectListen: "http://localhost:" + unusedPort + "/",
expectInternal: "https://host.example/",
},
+ { // implicit port 443 in ListenURL
+ internalURLs: map[string]string{"wss://host.example/": "wss://localhost/"},
+ expectErrorMatch: `.*:443: bind: permission denied`,
+ },
{
internalURLs: map[string]string{"https://hostname.example/": "http://localhost:8000/"},
expectListen: "http://localhost:8000/",