Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to establish IPv6 connections in websocket? #1496

Open
masterAllen opened this issue Jul 30, 2021 · 0 comments
Open

How to establish IPv6 connections in websocket? #1496

masterAllen opened this issue Jul 30, 2021 · 0 comments

Comments

@masterAllen
Copy link

Here is an example.

if __name__ == "__main__":
    factory = websocket.WebSocketServerFactory(u"wss://{WS_BIND_IP}:{WS_PORT}")
    factory.protocol = ServerProtocol
    listenWS(factory)
    reactor.run()

WS_BIND_IP is my ipv6 address and WS_PORT is 11111 for example. Then use wscat to test websocket.

wscat ws://127.0.0.1:11111 return Connected.
wscat ws://my_ipv4_address:11111 return Connected.
wscat ws://[::]:11111 return error: connect ECONNREFUSED :::11111
wscat ws://[my_ipv6_address]:11111 return error: connect ECONNREFUSED my_ipv6_address:11111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant