WebSocket
The protocol is quite simple, message based, and a very powerful tool to send push notifications to browsers, and has been used to implement chats, turn-based games, etc. It still uses a TCP connection, which is good for reliability but not for latency, so not good for real-time applications like VoIP and fast-paced games (see for those use cases).
Due to its simplicity, its wide compatibility, and being easier to use than a raw TCP connection, WebSocket soon started to spread outside the browsers, in native applications as a mean to communicate with network servers.
Godot supports WebSocket in both native and HTML5 exports.
Using WebSocket in Godot
Warning
When exporting to Android, make sure to enable the permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
This example will show you how to create a WebSocket connection to a remote server, and how to send and receive data.
This example will show you how to create a WebSocket server that listens for remote connections, and how to send and receive data.
This will print (when a client connects) something similar to this:
A more advanced chat demo which optionally uses the multiplayer mid-level abstraction and a high level multiplayer demo are available in the godot demo projects under networking/websocket_chat and networking/websocket_multiplayer.