Skip to main content

Geofencing

To meet the laws and regulations of different countries or regions, the Agora Signaling SDK supports geofencing. You can limit the data transmission of the Signaling SDK to a specific region. After enabling geofencing, the Signaling SDK only connects to Agora Signaling within the specified region.

Implementation

You need to call AgoraRTM.setArea method to specify the region for connection. After specifying the region, the SDK connects to the Agora servers within that region. The following regions are supported:

  • GLOBAL: (Default) Global.

  • CHINA: Mainland China.

  • ASIA: Asia excluding mainland China.

  • EUROPE: Europe.

  • INDIA: India.

  • JAPAN: Japan.

  • NORTH_AMERICA: North America.

If you specify the region for connection as GLOBAL, you can use the excludeArea parameter in the AgoraRTM.setArea method to remove individual region from the regions for connection possibilities.

Sample code


_4
// Set region for geofencing
_4
RtmServiceContext ctx = new RtmServiceContext();
_4
ctx.areaCode = RtmServiceContext.RtmAreaCode.AREA_CODE_CN | RtmServiceContext.RtmAreaCode.AREA_CODE_AS;
_4
RtmClient.setRtmServiceContext(ctx);

Considerations

Firewall requirements

If a firewall is deployed in your network environment, ensure that you add the domains in the following table according to the region you specify, allow all IP addresses, and open the following firewall ports.

  • Whitelist domains

    Region Domain

    Mainland China

    webrtc2-ap-web-2.agoraio.cn

    webrtc2-ap-web-4.agoraio.cn

    statscollector-3.agoraio.cn

    statscollector-4.agoraio.cn

    logservice-china.agora.io

    North America

    ap-web-1-north-america.agora.io

    ap-web-2-north-america.agora.io

    statscollector-1-north-america.agora.io

    statscollector-2-north-america.agora.io

    logservice-north-america.agora.io

    Europe

    ap-web-1-europe.agora.io

    ap-web-2-europe.agora.io

    statscollector-1-europe.agora.io

    statscollector-2-europe.agora.io

    logservice-europe.agora.io

    Japan

    ap-web-1-japan.agora.io

    ap-web-2-japan.agora.io

    statscollector-1-japan.agora.io

    statscollector-2-japan.agora.io

    logservice-japan.agora.io

    India

    ap-web-1-india.agora.io

    ap-web-2-india.agora.io

    statscollector-1-india.agora.io

    statscollector-2-india.agora.io

    logservice-india.agora.io

    Asia excluding mainland China

    ap-web-1-asia.agora.io

    ap-web-2-asia.agora.io

    statscollector-1-asia.agora.io

    statscollector-2-asia.agora.io

    logservice-asia.agora.io

  • Port - See the Firewall Requirements

API reference