I’m making a server with a DO app.

Websockets aren’t working (Firefox can’t establish a connection to the server)

Is it because of the port? How can I allow the port through? I tried making it 8080 (defined in my app spec as the http port), but that didn’t work. Tried making it a random port number, but that didn’t work either.

Are websockets blocked somehow? Do I need to allow the port somehow?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hey there!

Services that you run on the App Platform are exposed via app domains on port 443/HTTPS. So you should use the wss:// scheme when connecting. This is not necessarily the same port as you would specify that your service is listening on internally.

We have a sample nodejs repo that uses websockets and can be forked + deployed to the App Platform without any changes if that helps as a reference: https://github.com/snormore/sample-websocket

Hope that helps!
Nate