Rediger

Del via


WebSocket Protocol Component API

Purpose

The WebSocket Protocol Component API enables asynchronous, bi-directional communication channels over HTTP that work across existing network intermediaries. With the WebSocket Protocol Component API, a client uses HTTP to communicate with a server, and then both sides switch to using the underlying protocol that HTTP was layered on (such as TCP or SSL). The goal is to first use HTTP to traverse over network intermediaries, and then use the established end-to-end underlying TCP/SSL channel for bi-directional application communication. The WebSocket protocol [WSPROTO] is defined at the IETF, while an associated Javascript API (WebSockets) is defined at the WHATWG.

In this section

Topic Description
WebSocket Protocol Component API Data Types
The WebSocket Protocol Component API defines these data types.
WebSocket Protocol Component API Enumerations
The WebSocket Protocol Component API defines these enumerations.
WebSocket Protocol Component API Functions
The WebSocket Protocol Component API defines these functions.
WebSocket Protocol Component API Structures
The WebSocket Protocol Component API defines these structures.

Developer audience

The WebSocket Protocol Component API is designed for use by use by C/C++ programmers. Familiarity with HTTP and Windows networking is required.

Note

The preferred way to use the WebSocket protocol on Windows is through the Windows HTTP Services (WinHTTP) API or the Windows.Networking.Sockets namespace.

Run-time requirements

The WebSocket Protocol Component API requires Windows 8 and later versions of the Windows operating system. The APIs can be dynamically linked through websocket.dll.

Note

websocket.dll provides support for client and server handshake related HTTP headers, verifies received handshake data, and parses the WebSocket data stream. It does not handle any HTTP-specific operations (redirection, authentication, proxy support) nor perform any I/O operations (sending or receiving WebSocket stream bytes).

HTTP

Windows HTTP Services (WinHTTP)