Accepting IPv6 connections with autobahn.twisted.websocket?

#1

I’m running a websocket server using autobahn.twisted.websocket and it works perfectly for IPv4 connections but it doesn’t accept IPv6 connections.

The website itself supports IPv6 and is enabled and working but I cannot seem to figure out how to get it working with autobahn.

How do I configure autobahn to accept IPv6 connections?

if __name__ == "__main__":
 contextFactory = ssl.DefaultOpenSSLContextFactory('/path/to/domain.key', '/path/to/domain.cer')
 factory = websocket.WebSocketServerFactory(u"wss://[::]:9000")
 factory.protocol = ServerProtocol
 websocket.listenWS(factory, contextFactory)


 webdir = static.File(".")
 web = server.Site(webdir)
 reactor.listenSSL(9001, web, contextFactory, 50, "::")
 reactor.run()

With this code, websocket connections are able to be opened via IPv4 but it refuses to accept any IPv6 connections. Any ideas?

0 Likes