Browse Source

return error on listening domain address

Darien Raymond 6 years ago
parent
commit
aa4ab7fa03
1 changed files with 4 additions and 0 deletions
  1. 4 0
      transport/internet/tcp_hub.go

+ 4 - 0
transport/internet/tcp_hub.go

@@ -40,6 +40,10 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, settings
 		address = net.LocalHostIP
 	}
 
+	if address.Family().IsDomain() {
+		return nil, newError("domain address is not allowed for listening: ", address.Domain())
+	}
+
 	protocol := settings.ProtocolName
 	listenFunc := transportListenerCache[protocol]
 	if listenFunc == nil {