Direct Sockets (TCP, UDP)
Raw TCP and UDP sockets from a page, for installed isolated apps only.
In one line
Can open raw network connections only inside signed, installed apps, never on normal sites
Raw TCP and UDP sockets from a page, for installed isolated apps only.
Lets an installed Isolated Web App open arbitrary TCP and UDP connections and servers. Not available to normal websites because it would bypass same-origin and CORS protections.
What it can and can't do
What the user does: An organization installs a signed Isolated Web App on your computer
It can
- Open direct two way connections to other computers and devices
- Run small servers inside the installed app
- Reach local network devices if the app also has the extra network permission
It cannot
- Work on ordinary websites, ever
- Work on iPhone, Firefox or Safari
- Work on Chrome for Android or Samsung Internet
- Run without a signed bundle and an install by you or your IT team
How it differs between platforms: Only desktop Chromium has it, and only for signed Isolated Web Apps. Other browsers and phones do not.
Browser support
| Browser | Status | First version | Note |
|---|---|---|---|
| Chrome | Partial | Chrome 126 ChromeOS IWA only | None |
| Edge | Partial | Edge follows Chromium IWA | None |
| Firefox | Not supported | Not available | None |
| Safari | Not supported | Not available | None |
| Safari on iPhone | Not supported | Not available | None |
| Chrome on Android | Not supported | Not available | None |
| Samsung Internet | Not supported | Not available | None |
How a site asks for it
| API | new TCPSocket(host, port); new UDPSocket(); new TCPServerSocket(); policies direct-sockets, direct-sockets-private |
| Permission name | direct-sockets |
| Permissions policy | direct-sockets |
| Browser compat keys | api.TCPSocketapi.UDPSocket |
| How access is granted | install |
| What the user sees | Only inside Isolated Web Apps (signed bundles); IWA install prompt; permission policy direct-sockets, plus direct-sockets-private for LAN ranges. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Tied to the installed app |
| How to take it back | Uninstall the app |
| Inside an iframe | Via permissions policy only |
Typical flow
- User installs an Isolated Web App
- App requests TCPSocket
- Browser applies policy
- Socket opens
Data you get
What comes back: TCPSocket, UDPSocket, TCPServerSocket
Shape: object
How often: per connection
No individual data fields. The signal is the access itself.
Technical limits
- Isolated Web Apps only
- Not available to regular sites
The story
What it is
Installed special web apps can open raw network connections, like a desktop program.
For you
Only a few packaged apps can use this, and you install them first. You may see a permission step. If you do not install the app, nothing happens.
For makers
Makers get a way to bring remote desktop tools, game servers and device managers to the web without a native app. It needs strong trust, so it is limited to signed and installed apps.
Where you see it
| Type | Example | Apps |
|---|---|---|
| enterprise | A remote desktop app in a browser window connects to office computers over their own protocol, with no plugin installed. | None named |
| games | A web version of a game server list queries game servers directly over UDP to show player counts and ping. | None named |
| developer | A web based terminal connects to a device over raw network ports, so a developer can manage hardware from a browser app. | None named |
| smart-home | A web app sets up a smart light or printer by talking to its local network service directly. | None named |
| music | A web app for music studios sends live note data to other devices on the same network using raw network messages. | None named |
| security | A web based network tool scans office devices to find which are online, which is only allowed in an installed trusted app. | None named |
| education | A coding class tool lets students try network programs in a browser sandbox with real connections. | None named |
Risks
- Very powerful if abused
- Few apps need it
What the platform says
- MDN Web Docs: Direct Sockets API. A way for isolated apps to talk to devices and servers over plain TCP and UDP, as desktop apps can.
Good uses and abuse
Legitimate uses
- Remote shells
- Media servers
- IoT tools
Known abuse
- Would enable malware-like network access if opened to the web
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 5 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 3 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2024-06, Chrome 126: Direct Sockets for Isolated Web Apps
Related capabilities
Related
- Local Network Access (local-network). Can find and connect to devices on your home or office network, if you tap Allow
Sources
How well checked: Based on official documentation.