소스 검색

return error on listening domain address

Darien Raymond 7 년 전
부모
커밋
aa4ab7fa03
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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 {