rhasspy / wyoming

Peer-to-peer protocol for voice assistants
MIT License
103 stars 17 forks source link

Handle IPv6 URIs properly #7

Closed duckfullstop closed 7 months ago

duckfullstop commented 7 months ago

Wyoming's server implementation currently doesn't support ipv6 URI's; indeed, trying to pass one in results in the following trace:

File "/usr/local/lib/python3.9/dist-packages/wyoming/server.py", line 67, in from_uri

    host, port_str = result.netloc.split(":")

ValueError: too many values to unpack (expected 2)

Doing string.split on the netloc is a horrible way of handling parsing URIs, so I propose using the library's built in parser instead. This should be able to properly ascertain the address without breaking if a hostname contains a colon.

synesthesiam commented 7 months ago

Thanks!