Report this

What is the reason for this report?

How to connect Socket.io to App Platform

Posted on January 9, 2022

I have been trying to get my socket to connect to my server. I’ve been looking around and it seems I need to send a certificate with it somehow. If I put in the path into the url the page returns {“code”:1,“message”:“Session ID unknown”}. It’s a error 400 in the console.

I found this post, I think he is using a droplet though, but seem like I need to setup something like it. https://www.digitalocean.com/community/questions/socket-io-call-throwing-400-bad-request-for-some-users

I am not using a droplet, I have hosted the react app on the app platform and made the server as component of it with its path at /api. I have configured socket.io to use that path and know it is correct due to the url returning that error code.

Thanks

The developer cloud

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

Start building today

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