Struggling to get socket.io working correctly with Ngnix #4678
Replies: 2 comments 3 replies
-
Hi! In that case, you'll need to use a custom path
And specify the
import { Server } from "socket.io";
const io = new Server({
path: "/proxy/3000/socket.io/"
});
import { io } from "socket.io-client";
const socket = io({
path: "/proxy/3000/socket.io/"
}); |
Beta Was this translation helpful? Give feedback.
3 replies
-
Just a quick follow up on this - I wasn't able to get socket.io working with a code-server/nginx combination. I suspect it's something to do with code-server and how it allocates ports within the environment. I ended up running the running socket.io within it's own container. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm following this tutorial - https://socket.io/get-started/chat
I'm able to view the index.html via this URL https://code.myserver.xyz/proxy/3000/ but get a console error
GET https://code.myserver.xyz/socket.io/?EIO=4&transport=polling&t=OSoRsNc 404
I'm running a dockerized Code-server and have forward ported my the local instance to a domain
https://code.myserver.xyz/
using Nginx Proxy Manager (with a Let's Encrypt SSL).I suspect it's a combination of my nginx settings and incorrectly using the socket path
Here's what I've put in my nginx config:
Here's my index.html file
index.js file
Beta Was this translation helpful? Give feedback.
All reactions