any1 / neatvnc

A liberally licensed VNC server library with a clean interface
ISC License
118 stars 29 forks source link

wayvnc binds to 255.255.255.255 instead of 127.0.0.1 if started with localhost and port as parameters #23

Closed d4g closed 4 years ago

d4g commented 4 years ago

If I start wayvnc in the following way:

wayvnc -r -o eDP-1 localhost 6666

it binds to 255.255.255.255

lsof -i :6666                                                                                        ~
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
wayvnc  31112  redacted   12u  IPv4 314737      0t0  TCP 255.255.255.255:6666 (LISTEN)

If I start it with explicitly specifying 127.0.0.1 it starts as expected:

wayvnc -r -o eDP-1 127.0.0.1 6666
lsof -i :6666                                                                                        ~
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
wayvnc  32731  redacted   12u  IPv4 318435      0t0  TCP localhost:6666 (LISTEN)

Localhost is defined correct in my /etc/hosts:

cat /etc/hosts                                                                                       ~
127.0.0.1 localhost
127.0.1.1 my_local_hostname
::1 localhost
any1 commented 4 years ago

Neat VNC does not currently resolve host names. It should either do so or report an error when it cannot convert the ip address.