To meet the laws and regulations of different countries or regions, the Agora RTC SDK supports geofencing. After enabling geofencing, the Agora SDK only connects to Agora servers within the specified region.
For example, if you specify North America as the region for connection, the SDK only connects to Agora servers in North America. When there is no available server in North American, the SDK throws an error instead of connecting to servers in another region.
As of v3.1.2, the Agora RTC Web SDK supports geofencing.
When creating a client instance by calling createClient
, set the areaCode
parameter in ClientConfig
to specify the region for connection:
ASIA
: Asia, excluding Mainland ChinaCHINA
: Mainland ChinaEUROPE
: EuropeGLOBAL
: GlobalINDIA
: IndiaJAPAN
: JapanNORTH_AMERICA
: North Americavar config = {
mode: "live",
codec: "vp8",
// Specify the region as North America.
areaCode: [AgoraRTC.AREAS.NORTH_AMERICA]
};
// Create a client object.
var client = AgoraRTC.createClient(config);
If a firewall is deployed in your network environment, ensure that you whitelist certain domains, allow all IP addresses, and open certain firewall ports according to Firewall Requirements.