I saw that Socket.IO and Websockets usually require NodeJS or similar but don't run on clients.
Is there any possible way to open a port for accepting munications using JavaScript? So devices can talk to each other on a network, peer2peer (acting like a server)?
I saw that Socket.IO and Websockets usually require NodeJS or similar but don't run on clients.
Is there any possible way to open a port for accepting munications using JavaScript? So devices can talk to each other on a network, peer2peer (acting like a server)?
Share Improve this question asked Mar 18, 2017 at 14:54 Kevin Van RyckegemKevin Van Ryckegem 1,9454 gold badges30 silver badges55 bronze badges 1- browser extensions may be able to. javascript running in webpages is not – the8472 Commented Mar 18, 2017 at 15:15
1 Answer
Reset to default 6- You can't use real TCP or UDP sockets in the browser.
- You may use WebSockets to municate to a server which translates WebSocket connection to real socket connection. Server may be written in NodeJS or other language/platform.
- You can't listen for connections with WebSockets.
- You also may use WebRTC, which is also different from sockets, but better suited for peer-to-peer networks (I don't know very much about it).