WebSockets
WebSockets
Open WebSocket connections and exchange messages with a server.
Overview
A WebSocket request opens a connection that stays open until you or the server close it. Relay sends the handshake with the request's headers, authentication and cookies, then lets you send saved messages and watch everything the server sends back.
WebSocket requests live in collections and drafts alongside HTTP requests, and they use the same variables, authentication and settings.
Topics
Connections
- Connecting to a WebSocket server: Create a WebSocket request, configure its handshake and open a connection.
- Sending and receiving messages: Send saved text, JSON and binary messages, and read the connection's transcript.
See Also
- Receiving server-sent events: Watch an event stream as it arrives, filter its events and stop it when you're done.
- Generating code from requests: Turn a request into code for curl, Python, JavaScript, Swift and other languages.