Node.js websocket error “Error: listen EADDRNOTAVAIL Error: listen EADDRNOTAVAIL”

前端 未结 5 1570
萌比男神i
萌比男神i 2020-12-16 01:44

Application work fine on localhost .but when its connect to server it getting error.
I connect server through port 22

This is the error

Error:          


        
5条回答
  •  长情又很酷
    2020-12-16 02:17

    If you are only reaching this error after many requests, you might want to check your port range settings and adjust them. There is also TCP timeout settings, such as FIN_WAIT that can keep connections open for longer than expected.

    sysctl -a | grep net should show all network connection settings.

    sysctl -a | grep port for port range settings.

    sysctl -a | grep keep for tcp wait settings.

    See here and here(mac here) for a little more detail/advice on what the settings are.

    If you are going to modify settings, I would suggest that you first copy /etc/sysctl.conf to something like /etc/sysctl.conf.bak and then modify the setting in that file. They can be adjusted via the command-line but that is temporary and resetting them can be a mess.

    You probably don't want to do this in production.

    Additional docs:

    https://ma.ttias.be/linux-increase-ip_local_port_range-tcp-port-range/

    https://easyengine.io/tutorials/linux/sysctl-conf/

提交回复
热议问题