Posted On: Jun 29, 2020
While building a WebSocket API with Amazon API Gateway, you can now send back Sec-WebSocket-Protocol field as part of the response from $connect route. This means clients can now request specific subprotocols while connecting to your WebSocket API.
This feature allows you to support multiple subprotocols for a variety of your customers. Client can request the server to use specific subprotocols for communication by including Sec-WebSocket-Protocol field in its handshake. When this field is included as part of the request, you can send back the same field with setting the value to one of the selected subprotocol values.
This functionality is available in all regions where API Gateway is available today.
To learn more about using Sec-WebSocket-Protocol, please see our documentation. To learn more about API Gateway, visit our product page.