WebSockets · Schema

WebSocket Handshake Request

Schema describing the HTTP Upgrade request used to initiate a WebSocket connection as defined in RFC 6455 Section 4.1. The client sends this request to upgrade an HTTP connection to the WebSocket protocol.

Full DuplexNetworkingReal-Time CommunicationRFC 6455Web Technology

Properties

Name Type Description
method string The HTTP method must be GET for the WebSocket opening handshake.
requestUri string The Request-URI of the resource being requested, used to identify the WebSocket endpoint.
httpVersion string The HTTP version. Must be at least HTTP/1.1.
headers object HTTP headers required for the WebSocket opening handshake.
View JSON Schema on GitHub

JSON Schema

websocket-handshake-request.json Raw ↑
{
  "$id": "websocket-handshake-request.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "WebSocket Handshake Request",
  "description": "Schema describing the HTTP Upgrade request used to initiate a WebSocket connection as defined in RFC 6455 Section 4.1. The client sends this request to upgrade an HTTP connection to the WebSocket protocol.",
  "type": "object",
  "required": [
    "method",
    "headers"
  ],
  "properties": {
    "method": {
      "type": "string",
      "const": "GET",
      "description": "The HTTP method must be GET for the WebSocket opening handshake."
    },
    "requestUri": {
      "type": "string",
      "description": "The Request-URI of the resource being requested, used to identify the WebSocket endpoint.",
      "examples": [
        "/chat",
        "/ws/v1"
      ]
    },
    "httpVersion": {
      "type": "string",
      "description": "The HTTP version. Must be at least HTTP/1.1.",
      "examples": [
        "HTTP/1.1"
      ]
    },
    "headers": {
      "type": "object",
      "description": "HTTP headers required for the WebSocket opening handshake.",
      "required": [
        "Host",
        "Upgrade",
        "Connection",
        "Sec-WebSocket-Key",
        "Sec-WebSocket-Version"
      ],
      "properties": {
        "Host": {
          "type": "string",
          "description": "The host and optionally the port of the server being connected to.",
          "examples": [
            "example.com",
            "example.com:8080"
          ]
        },
        "Upgrade": {
          "type": "string",
          "const": "websocket",
          "description": "Must be 'websocket' to indicate the client wishes to upgrade to the WebSocket protocol."
        },
        "Connection": {
          "type": "string",
          "const": "Upgrade",
          "description": "Must include 'Upgrade' to signal the connection should be upgraded."
        },
        "Sec-WebSocket-Key": {
          "type": "string",
          "description": "A base64-encoded random 16-byte value used to prove the handshake was received. The server uses this to generate the Sec-WebSocket-Accept response header.",
          "pattern": "^[A-Za-z0-9+/]{22}==$"
        },
        "Sec-WebSocket-Version": {
          "type": "string",
          "const": "13",
          "description": "The WebSocket protocol version. Must be 13 as defined in RFC 6455."
        },
        "Sec-WebSocket-Protocol": {
          "type": "string",
          "description": "Optional comma-separated list of subprotocols the client wishes to use, ordered by preference.",
          "examples": [
            "chat, superchat",
            "graphql-ws"
          ]
        },
        "Sec-WebSocket-Extensions": {
          "type": "string",
          "description": "Optional list of protocol-level extensions the client wishes to use.",
          "examples": [
            "permessage-deflate; client_max_window_bits"
          ]
        },
        "Origin": {
          "type": "string",
          "format": "uri",
          "description": "The origin of the client making the request. Used by servers to accept or reject cross-origin connections."
        }
      },
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/websocket-handshake-request"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.