Godot 4 web exports are limited to what browsers allow: HTTP/HTTPS requests and WebSocket connections work normally. Raw TCP and UDP sockets do not work in the browser, so Godot’s low-level networking classes that depend on them are unavailable; multiplayer must go through WebSocket or WebRTC’s data channel instead.
At a glance
| Fact | Value | Source |
|---|---|---|
| Browser sandbox blocks raw sockets | TCP/UDP unavailable | docs.godotengine.org |
| Working transport in web exports | HTTP and WebSocket | developer.mozilla.org |
| Godot 4 web threading model | different from native | docs.godotengine.org |
Godot 4 web exports can only use the networking a browser actually allows: HTTP/HTTPS for regular requests (HTTPRequest node works fine) and WebSocket for persistent two-way connections. Godot’s StreamPeerTCP, PacketPeerUDP and the high-level multiplayer API built on raw ENet/UDP do not work in a web export, because browsers do not expose raw TCP or UDP sockets to page scripts. For real-time multiplayer in a web build you need a server that speaks WebSocket, or you route through WebRTC’s data channel, which itself needs a signaling step over HTTP or WebSocket to set up.
If your game also needs to talk to a non-networking browser API – ads, storage, platform login – that goes through JavaScriptBridge, Godot 4’s singleton for calling browser JavaScript from GDScript, replacing the old JavaScript singleton from Godot 3. This is the same pattern Unity WebGL uses with its .jslib plugin: the engine can’t reach the browser’s native APIs directly, so it calls out to JS. A practical shortcut here is Playgama Bridge, which ships a Godot 3 and 4 plugin and wraps ads, storage and platform calls behind one API instead of writing JavaScriptBridge calls by hand for each platform.
What should I check before shipping multiplayer on a Godot 4 web build?
- Test the actual export target (browser), not just the desktop editor – TCP/UDP code that runs in the editor will silently fail or error in the browser.
- Confirm your server exposes a WebSocket endpoint, not just raw sockets.
- If using WebRTC, verify the signaling path (HTTP or WebSocket) works before testing peer connections.
Sources
Related questions
Can I use raw TCP sockets in a Godot 4 web export?
No. Browsers do not expose raw TCP or UDP sockets to page scripts, so StreamPeerTCP and PacketPeerUDP based code will not work in a web export.
How do I call browser JavaScript from Godot 4?
Use the JavaScriptBridge singleton, introduced in Godot 4 to replace the old JavaScript singleton, to call browser APIs from GDScript in web exports.
Last updated: 24 September 2026