Update data over the internet

Persist data with SQLite

Work with WebSockets

Cookbook

Networking

Work with WebSockets

1. Connect to a WebSocket server

2. Listen for messages from the server

How this works

3. Send data to the server

How this works

4. Close the WebSocket connection

Complete example

In addition to normal HTTP requests,
you can connect to servers using WebSockets.
WebSockets allow for two-way communication with a server
without polling.

In this example, connect to a
test WebSocket server sponsored by Lob.com.
The server sends back the same message you send to it.
This recipe uses the following steps:

Connect to a WebSocket server.

Listen for messages from the server.