DEV Community

Cover image for Getting started with Web Sockets in NodeJS

Getting started with Web Sockets in NodeJS

Simon Pfeiffer on November 25, 2021

In the day and age of live streaming, video conferencing, and remote work, one of the primary concerns of any user is latency. A seamless experienc...
Collapse
 
spock123 profile image
Lars Rye Jeppesen

Webserver config/support, as well as reverse proxy should have an article of its own.

Nobody hosts a nodejs raw onto the Internet.

Great article, cheers

Collapse
 
simoncodephere profile image
Simon Pfeiffer

thanks! appreciate the feedback!

Collapse
 
prabhukadode profile image
Prabhu

Good

Collapse
 
prateshdeevra profile image
pratesh-deevra

Amazing! I will use this

Collapse
 
simoncodephere profile image
Simon Pfeiffer

Glad to hear that! :)

Collapse
 
mpv65 profile image
Martin Vaughan

Very useful article. Quick question: where does the 'myWebsocket' in the url ws://localhost:9876/myWebsocket come from? Is this a default path with ws?

Collapse
 
lucidmach profile image
Nukala Suraj

umm nope... "myWebsocket" in the url is the route that websocket supported

Collapse
 
hello_i_am_nice profile image
Maria

we have to implement this route by ourselves? or I cant understand how to connect frontend with this route? In node.js code snippet I dont see anything about this route

Thread Thread
 
behzadkhodapanah1993 profile image
Behzad Khodapanah

myWebsocket is a namespace, You can change it for whatever you want to, and in your html you must connect to your namespace. good luck

Collapse
 
travisl12 profile image
Travis Lawrence

Why do you reject half of the connection requests?

Collapse
 
sampdiamond profile image
Sam

Great stuff. Thank you very much 🙂

Collapse
 
syedshaheerhasan profile image
Syed-Shaheer-Hasan

let me know how we see output after coding

Collapse
 
bhalchandra_kalloorkar profile image
Bhalchandra Kalloorkar

This is a great tutorial.