Deploying the Enterprise Proxy

This page shows how enterprises can use the API provided by the Agora Signaling SDK for Web to access Agora’s services through a company firewall.

This page applies to the Agora Signaling SDK for Web only. Proxy services by different service providers may result in slow performance if you are using the Firefox browser. Therefore, Agora recommends using the same service provider for the proxy services. If you use different service providers, Agora recommends not using the Firefox browser.

Introduction

Enterprises may restrict employees’ access to unauthorized websites through a company firewall, which may restrict access to Agora’s services as well. Agora provides one interface in the Signaling SDK for Web, which allows requests to bypass the company firewall and reach Agora SD-RTN directly through proxy servers. Enterprises can deploy Nginx Server and call the provided interface to enable internal access to Agora’s services.

How the Proxy Works

The following figure shows how the proxy works:

../_images/proxy_web_signaling.jpg
  • The enterprise deploys an Nginx proxy server.

  • The enterprise users call the method provided by the Signaling SDK for Web. Signaling messages are passed to Agora through the Nginx Server, thus enabling access to Agora’s services.

How to Deploy the Proxy

You need to deploy the Nginx Server by yourself before calling the method in the Signaling SDK for Web to enable the Proxy service. Refer to the following steps to deploy the Nginx server.

Deploying the Nginx Server

Please ensure that you have acquired the domain name and certificate of the Nginx Server before proceeding.

1. Install the Nginx Server

Refer to the steps in Nginx Installation Guide to deploy the Nginx Server.

2. Configure the conf file of the Nginx Server

  1. Run the following command line:
sudo vim /etc/nginx/nginx.conf
  1. Add the following configuration in the http domain of the conf file
resolver 8.8.8.8;
server {
    listen  80;
    listen  443;
    server_name <you dns>;
    ssl     on;
    ssl_certificate         <you certificate file absolute path>;
    ssl_certificate_key     <you certificate key file absolute path>;

    location /ws/ {
            proxy_pass https://$arg_h:$arg_p;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }
}
  1. Run the following command line
sudo nginx -s reload

Call the Method in the Signaling SDK for Web to Set the Proxy

Set the name and value parameters in the setupdebugging API

setup_debugging(name, value)

Set the proxyServer and turnServer parameters:

Name Description
name proxy_server: Enterprises with a company firewall can deploy the Nginx Server and then use this parameter to pass signaling messages to Agora through Nginx
value Your server IP or URL