Since you are not asking for a workaround, but the full background:
- Check what addresses your bind_host (ie. "localhost") resolves to:
$ python3 -c "import socket
print(set([a[4][0] for a in socket.getaddrinfo('localhost', 4822)]))"
{'127.0.0.1', '::1'}
- Possibly open a new issue for guacd to properly implement support for dual-stack IPv4/IPv6 and allow specifying a bind_host which has multiple different addresses.
I did some work fixing IPv6-only support in guacd https://issues.apache.org/jira/browse/GUACAMOLE-1190 which was sufficient for my purposes.
Supporting proper IPv6 dual-stack in any TCP server, while also allowing the user to restrict binding to specific addresses means:
- Create multiple sockets
bind()
to all addresses returned by getaddrinfo()
(127.0.0.1 and ::1 for "localhost")
listen()
on all successfully bound sockets
- Use
select()
or poll()
to react to incomming clients on all bound sockets at once
- Call
accept()
to accept a client connection after select()
returns without error for a certain socket in the set
For reference see these answers/sites:
Semantics of :: and 0.0.0.0 in dual-stack OSes
How to support both IPv4 and IPv6 connections
select - synchronous I/O multiplexing