WebSockets
Last updated 2025-11-04
Fastly supports the use of the WebSocket protocol. This protocol allows you to establish long-lived, two-way, interactive communication sessions between an end user's client (such as a web browser) and your servers.
Limitations and considerations
Keep in mind the following limitations and considerations:
- WebSockets is not compatible with shielding or the Fastly Next-Gen WAF.
- When adding a host to your Fastly service configuration, only the Name, Address, Enable TLS, and Override Host origin server settings are supported with WebSockets.
- When handling a WebSocket request,
vcl_logwill run at the time the request is accepted rather than when the connection ends. - Client request headers that are added, removed, or modified on your
Request(orreq.httpin VCL) will be reflected in the WebSocket handoff. - If you have TLS certificates on your origin server, they must be signed by a public certification authority. Self-signed TLS certificates are not supported.
Billing
NOTE
Billing limits for this product may be different if you've purchased a packaged offering or are using a product or feature trial.
Use of the WebSocket protocol is disabled by default. Users assigned the superuser role can enable it on the Products page. Once enabled, any user on your account with the appropriate permissions will be able to use this communications protocol.
Enabling WebSockets on your account will also result in changes to your monthly bill. We base billing for WebSockets on a combination of bandwidth and connection time. Connection time is measured for each connection in usage minutes (rounded up to whole minutes) and aggregated monthly to millions of minutes. Bandwidth is included as part of your overall delivery bandwidth rate in your monthly billing statement.
Some Fastly products can be purchased directly in the web interface on the Products page. For more details about a product, including pricing information or for help purchasing it, contact your account manager or email sales@fastly.com.