Direct Sockets API in Shared/Service workers
- Category
- Network / Connectivity
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Allows Isolated Web Apps to establish direct transmission control protocol (TCP) and user datagram protocol (UDP) communications with network devices and systems as well as listen to and accept incoming connections from shared /service workers. The Direct Sockets API has been launched in Chrome 131 for window & dedicated worker contexts; this separate entry aims at expanding these to accommodate shared / service workers to achieve parity with the exposure of other networking capabilities such as fetch() or WebSockets. See https://chromestatus.com/feature/6398297361088512 for more context.
Motivation
Many network devices use their own protocols over TCP or UDP, instead of using HTTPS. Like WebUSB, WebMIDI and WebBluetooth, this API allows web apps to communicate with local devices and information systems.
Standards & signals
- Specification: https://wicg.github.io/direct-sockets
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=direct-sockets-api-in-shared-service-workers
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Direct%20Sockets%20API%20in%20Shared%2FService%20workers
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Direct%20Sockets%20API%20in%20Shared%2FService%20workers
- Baseline status: https://webstatus.dev/?q=Direct%20Sockets%20API%20in%20Shared%2FService%20workers
Explainers: https://github.com/WICG/direct-sockets/blob/main/docs/explainer.md