Deploy a request proxy
In complex network environments, network carriers may hijack the default ApsaraVideo VOD domain name (*.aliyuncs.com), causing access failures. Deploy a dedicated proxy service to improve request success rates and stability.
Before you begin
The following example uses Alibaba Cloud Function Compute (FC) 3.0. Before you begin, review Function Compute billing.
Procedure
Follow these steps:
If your Function Compute (FC) console displays the 2.0 interface, click Go to Function Compute 3.0 in the upper-right corner to switch to the new console.
Step 1: Create a function
-
Go to the Functions page in the Function Compute (FC) console and click Create Function.
-
Select Task Function and click Create Task Function. Configure the following parameters:
-
For the runtime environment, select Built-in Runtimes > Python.
-
Keep the default settings for other parameters or configure them as needed. For function type, select Task Function. In the elastic configuration, set the instance type to elastic instance with 0.35 vCPU, 512 MB of memory, and a 512 MB disk. Set the minimum number of instances to 0 (recommended) and the single-instance concurrency to 1. For the code upload method, select Use sample code. Then, click Create.
-
-
Review your configuration and click Create.
Step 2: Deploy the code
-
On the Function Details page, click the Code tab.
-
Click Open WebIDE to open the code editor.
-
Copy the following code into the editor.
-
Return to the Function Details page and click Deploy Code.
Step 3: Create a trigger
-
On the Function Details page, click the Triggers tab.
-
Click Create Trigger and select HTTP Trigger. We recommend setting Authentication Method to No Authentication and keeping the default settings for other parameters or changing them as needed. Enter a trigger name, set the version or alias to LATEST, and select the GET, POST, PUT, and DELETE request methods.
-
Review your configuration and click OK.
Step 4: Verify the deployment
-
On the trigger management page in the Function Compute console, find the HTTP trigger that you created and copy its public access address. Access this address in your browser to test the connectivity. You can also set the customVodServer property in your player to this address to access the proxy service.
-
A successful connection confirms that the request proxy has been deployed.
Related documents
-
To integrate the web player SDK, see Quick Integration.
-
For details about the customVodServer property, see Aliplayer API Reference.