All Products
Search
Document Center

Edge Security Acceleration:WebSocket

Last Updated:Sep 19, 2024

If you want your origin server to allow WebSocket requests whose URLs begin with ws:// or wss://, you can enable the WebSocket feature on Edge Security Acceleration (ESA). After you enable the feature, ESA can communicate with the origin server over the WebSocket protocol to transmit and update data in real time. By default, the WebSocket feature is enabled. You do not need to separately configure the feature.

Background information

WebSocket is a TCP-based protocol that implements persistent and full-duplex communications between a client and a server and allows the server to actively send information to the client. Before the rise of WebSocket, web applications make inquiries for duplex communications by continuously sending HTTP requests. This reduces service efficiency and increases costs. WebSocket requires only one handshake between the client and the server to establish a persistent connection and implement bi-directional data transmission. This saves server resources and bandwidth, and ensures communications in real time.

Common scenarios

Scenario

Description

Live commenting

User A posts a comment from a mobile phone and wants to view live comments from other clients on the phone. To meet this requirement, WebSocket is used to push the live comments from other clients to the mobile phone of User A. This way, User A can view the live comments sent by other users.

Online education

In the one-to-many online education scenario, WebSocket can be used to push the notes and syllabuses edited on the client of the teacher to the clients of the students in real time.

Real-time quotes for financial products

Constantly changing stock and gold prices can be pushed to clients around the world in real time over the WebSocket protocol. This facilitates financial decision-making in trading.

Live sportscasts

Live sportscasts are the top concern of a large number of sports fans all over the world. WebSocket satisfies the requirements of these sports fans by providing real-time sports updates.

Video conferencing

Video conferencing is adopted in a wide range of scenarios. In a video conference, participants join the conference from multiple devices. WebSocket helps deliver real-time information to these participants.

Location-aware applications

An increasing number of developers apply the GPS capabilities of mobile devices to location-aware applications. Based on the physical user location that is continuously updated, the location-aware applications can provide tailored offerings and information to users.

Procedure

  1. Log on to the ESA console.

  2. In the left-side navigation pane, click Websites.

  3. On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.

  4. In the left-side navigation tree, click Network.

  5. Turn on or off the WebSocket switch based on your business requirements. By default, the switch is turned on.

    image