Possible to skip nodejs? #4260
-
Hello! I was looking at socketio and I am very interested for using it for some projects. However I am trying to figure out if it is possible to run the server in the browser without nodejs or any other server running on a local machine? The use case is I want users to be able to host a server in their browser without having to install anything since I cannot not afford servers to host and the project I am working on would work fine with people hosting their own servers(even if they have to port forward). My other question is if I can host a server purely in the browser let's say I didn't have an internet connection can someone else on the same network connect to me offline. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi! Socket.IO, like plain WebSockets, is designed for server to client communication. That being said, you might be interested in WebContainers, which provide a way to run Node.js in the browser: https://blog.stackblitz.com/posts/introducing-webcontainers/ You may also check peer-to-peer communication and WebRTC, which sounds really close to your use case. |
Beta Was this translation helpful? Give feedback.
Hi!
Socket.IO, like plain WebSockets, is designed for server to client communication.
That being said, you might be interested in WebContainers, which provide a way to run Node.js in the browser: https://blog.stackblitz.com/posts/introducing-webcontainers/
You may also check peer-to-peer communication and WebRTC, which sounds really close to your use case.
Reference: https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC/Peer-to-peer_communications_with_WebRTC