Gateway support for WebSocket

WebSocket is a protocol that provides full-duplex communication channels over a single TCP connection, enabling real-time data exchange between clients and servers. API Gateway supports endpoints that use the WebSocket protocol, providing a robust framework for real-time communication.

Overview

Unlike traditional HTTP, which follows a request–response model, WebSocket allows a persistent connection that reduces latency and improves application performance. This makes it suitable for applications that require continuous data streaming, such as live chat, online gaming, and financial trading platforms.

Benefits of using the WebSocket protocol

  • Lower latency: The persistent connection reduces the need for constant reconnection, leading to faster data transmission.
  • Efficient message format: WebSocket frames are smaller than HTTP headers, resulting in more efficient data exchange.
  • Real-time communication: Enables instant updates and interactions, making it ideal for dynamic applications.
  • Reduced overhead: Because the connection remains open, there is less overhead compared to opening multiple HTTP connections.
  • Bi-directional communication: Both client and server can send messages independently, enabling more interactive features.

WebSocket support in API Gateway

API Gateway supports adding endpoints that use the WebSocket protocol, providing a reliable structure for real-time communication. The following sections describe how to set up, test, and monitor WebSocket endpoints within API Gateway. This ensures seamless integration and optimal performance of WebSocket-based services.