erming / shout

Deprecated. See fork @ https://github.com/thelounge
MIT License
3.62k stars 273 forks source link

Error: connect EINVAL #431

Open dbkaplun opened 9 years ago

dbkaplun commented 9 years ago

When I set bind: "127.0.0.1" instead of bind: undefined in ~/.shout/config.js:

$ cat /var/log/upstart/shout.dbkaplun.com.log
Config created:
/home/prod/.shout/config.js

Shout is now running on http://127.0.0.1:5071/
Press ctrl-c to stop

User 'dbkaplun' loaded.
Client#connect():
Error: connect EINVAL
Client#connect():
Error: connect EINVAL
Client#connect():
Error: write after end
Client#connect():
Error: write after end
Client#connect():
Error: connect EINVAL

Shout is now running on http://0.0.0.0:5071/
Press ctrl-c to stop

User 'dbkaplun' loaded.
Client#connect():
Error: connect EINVAL
dcposch commented 8 years ago

I ran into the same problem.

  1. Setting bind: "127.0.0.1"
    • Loading the Shout login page works
    • Actually connecting to an IRC server doesn't work. Prints "Connection failed", and the console on the server shows EINVAL errors as above
  2. Setting bind: undefined
    • Everything works

Furthermore, I think the bind option doesn't quite work as advertised. Even with bind: undefined, the program binds localhost, not 0.0.0.0:

# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      12125/node
...
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      12095/nginx
...