Add transport: server-sent events
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
Note: for support questions, please use one of these channels: stackoverflow or slack
You want to:
- report a bug
- request a feature
Current behaviour
The transports available are http polling and websocket.
Steps to reproduce (if the current behaviour is a bug)
N/A
Expected behaviour
To have the option of a new transport available: sse (server-sent events)
Setup
- OS: Any
- browser: Any (Edge requires a polyfill)
- engine.io version: 3.4.0
Other information (e.g. stacktraces, related issues, suggestions how to fix)
Server-sent events have existed for many years now as an option to push events from the server to the browser [1]. It is the ideal mechanism for some use-cases and has the potential to greatly save on power usage on mobile devices [2]. This is the sole transport used by Mercure [3], a new protocol for real-time communications that I believe might become a direct competitor to Socket.io.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
[2] https://www.smashingmagazine.com/2018/02/sse-websockets-data-flow-http2/
[3] https://github.com/dunglas/mercure
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reading the linked MDN server-sent events documentation and comparing it with the existing HTTP polling and WebSocket transports. Done means SSE is available as a selectable transport and works across the stated browser environments, including Edge with its polyfill.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100