socketIO-client
socketIO-client copied to clipboard
IPv6 support
The url parser is broken for raw IPv6 addresses. The extra colons in the output from parsers.parse_host
confuse other parts of the code.
A simple fix is to apply this patch to socketIO_client/parsers.py
:
20c20,23
< url = '%s:%s%s/%s' % (url_pack.hostname, port, url_pack.path, resource)
---
> if ':' in url_pack.hostname:
> url = '[%s]:%s%s/%s' % (url_pack.hostname, port, url_pack.path, resource)
> else:
> url = '%s:%s%s/%s' % (url_pack.hostname, port, url_pack.path, resource)
That worked for me, but there might be a better way to do this. In either case, please fix this.
This is still relevant in 2019. I would like very much to be able to use ipv6 addresses.