Basic example of WebSocket, Socket.io, Server-Sent Events(SSE), regular & long polling
- WebSocket dir: /websocket
node app.js
- Socket.io dir: /socketio-chat
node app.js
- Server-Sent Events (SSE) dir: /server-sent-events
node server.js
- Regular Pooling dir: /long-polling
npm install -g browser-sync
browser-sync start --server --files "./"
- Long Polling dir: /long-polling
go run main.go
For automatically reload application, recommend to use nodemon, fresh
- https://socket.io/
- https://javascript.info/websocket
- https://javascript.info/long-polling
- https://javascript.info/server-sent-events
- https://gofiber.io/
- https://github.com/LdDl/fiber-long-poll
- https://expressjs.com/
- https://github.com/websockets/ws
- https://www.fastify.io/
- https://github.com/lolo32/fastify-sse
- https://materializecss.com/
- https://browsersync.io/
- https://nodemon.io/
- https://github.com/gravityblast/fresh