socketIO-client icon indicating copy to clipboard operation
socketIO-client copied to clipboard

IPv6 support

Open duvallj opened this issue 7 years ago • 1 comments

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.

duvallj avatar Dec 22 '17 19:12 duvallj

This is still relevant in 2019. I would like very much to be able to use ipv6 addresses.

DDR0 avatar Jan 26 '19 05:01 DDR0