tencent cloud

Configuring UDP and TCP Listeners

Download
Focus Mode
Font Size
Last updated: 2026-09-04 16:28:43
AI-Translated

Listener Overview

After creating a Global Accelerator 2.0 (GA2.0) instance, you need to configure a listener for the instance. The listener is responsible for listening to client requests and distributing traffic to backend endpoints.
The following needs to be configured for a GA2.0 listener:
1. Listening protocol and listening port. The listening port of a listener, also known as the frontend port, is used to receive requests and forward them to the real server.
2. Listening policies. For example, load balancing policies and session persistence.
3. An added endpoint group. You need to create an endpoint group and add endpoints to it.

Supported Protocol Types

GA2.0 can listen to layer-4 and layer-7 requests from clients and distributes them to backend endpoints, which then handle the requests. The difference between a layer-4 and a layer-7 listener primarily lies in whether a layer-4 protocol or a layer-7 protocol is used to forward traffic when a user request arrives. For example, layer-4 forwarding is performed on requests with layer-4 protocols such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), and layer-7 forwarding is performed on requests with layer-7 protocols such as Hypertext Transfer Protocol (HTTP) and Hypertext Transfer Protocol Secure (HTTPS).
Layer-4 protocol: a transport layer protocol, which primarily receives requests and distributes traffic to real servers through VIP+Port
Layer-7 protocol: an application layer protocol, which distributes traffic based on application layer information such as URL and HTTP header
Tencent Cloud GA2.0 can forward requests with the following protocols:
TCP (transport layer)
UDP (transport layer)
HTTP (application layer)
HTTPS (application layer)
Protocol Category
Protocol
Description
Scenario
Layer-4 protocol
TCP
A connection-oriented and reliable transport layer protocol.
The source and destination of the transmission need to perform a three-way handshake to establish a connection before data transmission.
It supports session persistence based on the client IP address (the source IP address).
It allows you to obtain the client source IP address.
It is suitable for scenarios that require high reliability and data accuracy but have lower requirements for transmission speed, such as file transfer, email sending and receiving, and remote login.
UDP
A connectionless transport layer protocol.
The source and destination of the transmission do not establish a connection and do not need to maintain the connection status.
Each UDP connection can only be point-to-point.
It supports one-to-one, one-to-many, many-to-one and many-to-many interactive communications.
It supports session persistence based on the client IP address (the source IP address).
It is suitable for scenarios that require high transmission efficiency but have relatively lower requirements for accuracy, such as instant messaging and online video.
Layer-7 protocol
HTTP
An application layer protocol.
It supports forwarding based on the request domain name and URL.
Applications that need to identify the content of requests, such as Web applications, App services. For details, see Configure HTTP and HTTPS Listeners.
HTTPS
An encrypted application layer protocol.
It supports forwarding based on the request domain name and URL.
With the unified certificate management service, you can upload and replace a certificate in the GA2.0 console.
It supports one-way authentication and mutual authentication.
HTTP applications that require encrypted transmission. For details, see Configuring HTTP and HTTPS Listeners.

Supported Port Ranges

Port Type
Description
Limit
Listening port (frontend port)
The listening port is the port through which GA2.0 receives requests and forwards them to endpoints. The configurable port range is 1–65499.
For one GA2.0 instance:
A listening port of the UDP protocol category can be duplicated with a listening port of the TCP protocol category. For example, you can create the listener TCP: 80 and the listener UDP: 80 at the same time.
Listening ports of the same protocol category cannot be duplicated. TCP/TCP SSL/HTTP/HTTPS are all in the TCP category. For example, you are not allowed to create the listener TCP: 80 and the listener HTTP: 80 at the same time.
Endpoint port (backend port)
The endpoint port can be configured for a layer-7 listener. It is the port through which the real server provides services, and it receives and handles traffic from GA2.0.
The configurable endpoint port range is 1–65499.
For one GA2.0 instance:
Service ports of different listening protocols can be duplicated. For example, the listener HTTP: 80 and the listener HTTPS: 443 can be bound to the same port of a real server at the same time.
Health check port
The health check port is used by GA2.0 to send probe requests to real servers to confirm whether the servers are running normally. If the port responds normally, the servers are considered healthy. The configurable health check port range is 1–65499.
-
You need to create a listener for a GA2.0 instance to listen to user requests and forward traffic to backend endpoints. GA2.0 supports the TCP, UDP, HTTP, and HTTPS protocols. This document describes how to configure and operate TCP and UDP listeners.

Operation Steps

Prerequisites

The GA2.0 instance has been created.

Creating a Listener

1. Log in to the GA2.0 console.
2. On the standard instance list page, click the target instance ID and go to the instance details page.
3. Click Add Listener on the listener tab.
4. Configure a listener.
Configuration Type
Configuration Item
Description
Basic Configuration
Listener Name
It starts with an uppercase or lowercase letter.
It supports 2 to 128 characters in length.
It supports digits, periods (.), hyphens (-), and underscores (_).
Routing Type
Intelligent routing: Select the nearest endpoint group based on latency for forwarding.
Protocol
You can select TCP, UDP, HTTP, and HTTPS.
TCP: A connection-oriented protocol that provides reliable transmission (through acknowledgment/retransmission mechanisms) and ensures data order. It is suitable for scenarios that require high reliability, such as web browsing (HTTP/HTTPS), file transfer (FTP), and email (SMTP).
UDP: A connectionless protocol that provides unreliable transmission and low latency. It is suitable for scenarios that are sensitive to speed and tolerant of packet loss, such as real-time audio and video (for example, VoIP), online gaming, and DNS queries.
Port
The supported port range is 1–65499.
Advanced Configuration
Obtain Client Source IP
TCP: After it is enabled, the client's real IP address can be obtained through the ProxyProtocol or ProxyProtocol V2 proxy protocol.
UDP: The client's real IP address can be obtained through the ProxyProtocol V2 proxy protocol.
Session Persistence
Enabled: Users' requests from the same IP address are forwarded to the same origin server.
Disabled: Users' requests from the same IP address may not be forwarded to the same origin server.
Idle Connection Timeout Period
Specify the idle connection timeout period. If no data interaction occurs during the timeout period, GA2.0 terminates the current connection and establish a new connection when the next request arrives. The value range varies depending on the listening protocol.
TCP listening: The value range is 10–900 (in seconds), and the default value is 900 (in seconds).
UDP listening: The value range is 10–20 (in seconds), and the default value is 20 (in seconds).
5. Configure an endpoint group.
When creating a listener, you can create the default endpoint group for it to receive the traffic forwarded by the listener to the backend. When configuring the endpoint group, you need to add endpoints to it and enable health check as needed.
Note:
The node group configured when a listener is first created is the default endpoint group. For a TCP or UDP listener, you can only create one default endpoint group, but a custom endpoint group cannot be created.
Configuration Type
Configuration Item
Description
Endpoint Group
Endpoint Group Name
It starts with an uppercase or lowercase letter.
It supports 2 to 128 characters in length.
It supports digits, periods (.), hyphens (-), and underscores (_).
Region
The region of the endpoint group. GA2.0 forwards traffic from the acceleration region to the region of the endpoint group.
Attention:
If the acceleration region and the region of the endpoint group are the same, it might cause poor acceleration.
Backend Service Type
The endpoint, which functions as the backend origin server and eventually provides services. The endpoint type can be a custom domain name or a custom IP address.
Backend Service
The backend origin server that eventually provides services. You can add up to 4 endpoints to an endpoint group. You can enter custom IP addresses or custom domain names. Example:
117.89.1.1
example.com
Weight
The endpoint weight. GA2.0 distributes business traffic to real servers based on the endpoint weight you configure.
Default value: 100.
Configurable range: 1–100.
Port Mapping
Listening port: The input port must match the port configured for the current listener.
Endpoint port: The port on which the endpoint provides services. The port range is 1–65499.
Health Check
Enabled: GA2.0 checks the availability of the backend origin server based on the configured health check parameters.
Disabled: GA2.0 does not perform health check probes on the origin server.
Protocol Check
The network protocol used by GA2.0 to check whether the real server is available.
TCP: TCP and custom detection are supported.
TCP: GA2.0 uses TCP to check whether the real server is available.
Custom detection: You can manually configure the check requests and returned check results of health checks to check the real server.
UDP: Ping and custom detection are supported.
PING: GA2.0 uses ping to check whether the real server is available.
Custom detection: You can manually configure the check requests and returned check results of health checks to check the real server.
Response Timeout Period
The maximum time that GA2.0 waits for the server to respond after sending a health check request to the real server. If no response is received after the timeout period ends, this check is determined as failed.
Default value: 2 (in seconds).
Configurable range: 2–60 (in seconds).
Health Check Interval
The time interval between two health checks.
Default value: 30 (in seconds).
Configurable range: 5–300 (in seconds).
Unhealthy Threshold
After the number of consecutive health check failures reaches the threshold, the real server is marked as unhealthy and removed from the traffic distribution pool.
Default value: 3 (in counts).
Configurable range: 1–10 (in counts).
Healthy Threshold
After the number of consecutive health check successes reaches the threshold, an unhealthy server is re-marked as healthy and its traffic distribution is restored.
Default value: 3 (in counts).
Configurable range: 1–10 (in counts).

Editing a Listener

1. Log in to the GA2.0 console.
2. On the instance list page, click the target instance ID and go to the instance details page.
3. Click Listener and go to the listener list page.
4. Click the target instance ID or Instance Details in the Operation column to go to the listener instance details page.
5. In the Operation column of an existing listener, click the Configuration Management drop-down list and click Manage Endpoint Group to go to the endpoint group list page and manage the endpoint groups.

Deleting a Listener

1. Log in to the GA2.0 console.
2. On the instance list page, click the target instance ID and go to the instance details page.
3. Click Listener and go to the listener list page.
4. Click Delete on the right of the listener.
5. In the pop-up window, click OK to complete the deletion.
Attention:
After you delete a listener, the binding relationships between all listeners and endpoint groups within the group are released. Your service can no longer be accelerated, and the deleted configuration cannot be restored or accessed. Please fully confirm the impact before proceeding with the deletion.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback