Skip to content

Basic example of WebSocket, Socket.io, Server-Sent Events(SSE), regular & long polling

License

Notifications You must be signed in to change notification settings

afif-dev/ws-sse-polling

Repository files navigation

WebSocket, Socket.io, Server-Sent Events(SSE), Regular & Long Polling

Basic example of WebSocket, Socket.io, Server-Sent Events(SSE), regular & long polling

Setup for Local Development

  1. WebSocket dir: /websocket
node app.js
  1. Socket.io dir: /socketio-chat
node app.js
  1. Server-Sent Events (SSE) dir: /server-sent-events
node server.js
  1. Regular Pooling dir: /long-polling
npm install -g browser-sync
browser-sync start --server --files "./"
  1. Long Polling dir: /long-polling
go run main.go

For automatically reload application, recommend to use nodemon, fresh

Screenshot

Reference Links

About

Basic example of WebSocket, Socket.io, Server-Sent Events(SSE), regular & long polling

Topics

Resources

License

Stars

Watchers

Forks