Socket.io does not work on the ubuntu 16.04

前端 未结 1 1359
天命终不由人
天命终不由人 2020-12-20 06:32

I have an issue with socket.io. When I run my code on my computer (local) I can use http://IP:120/socket.io/socket.io.js. However, on my server (Digital ocean server ubuntu

相关标签:
1条回答
  • 2020-12-20 06:50

    The solution is related to setting up the ports required for the communication.
    By default, all ports except :80 are blocked in Digital Ocean

    You need to open your port 120 first:

    iptables -I INPUT 1 -i eth0 -p tcp --dport 120 -j ACCEPT
    
    0 讨论(0)
提交回复
热议问题