Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello,
I have a nodeJS app which works fine locally. It listens to localhost:3001 for Http/web traffic, and then establishes a websocket connection on localhost:3002 for web sockets. Everything works fine when running locally, and the nginx proxy through to localhost:3001 works fine for the http connection.
The problem is the websocket connection. The statement const wsS = new WebSocketServer({ 3002, clientTracking: true }); works fine locally.
But on my Droplet it barfs with:
WSServer.e: {"code":"EADDRINUSE","errno":-98,"syscall":"listen","address":"::","port":3002}
I am sure that there is nobody else using that port - I can run this right after a machine reboot and get the error. also (thanks to an old support thread for this) “lsof -i:3002” shows nothing. And “pm2 list” also shows nothing.
So what’s it bitching about? :). Any attempt to then use that web socket fails. I’m getting the error running “node index.js” on the box without even pinging it from outside. I can ping the web server from outside, so I think the nginx proxying is ok, BTW.
Oh and here’s the ufw output:
To Action From
-- ------ ----
22/tcp LIMIT Anywhere
Nginx Full ALLOW Anywhere
OpenSSH ALLOW Anywhere
80/tcp ALLOW Anywhere
22/tcp (v6) LIMIT Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
Thanks in advance!
ebeecroft
Noor Bakkal
384d3f11289345379905a243f7b817
IsaacMvd
Ervan Agus
Teckno
dc1bce8262314f84b368813178d9e4
gerard
gerard
Stan Flint