Oxylabs Documentation
English
Search
K

Proxy Rotator - Optional

This service is optional, if you wish to use Proxy Rotator - contact your Account Manager to receive a domain.
Instead of connecting to individual IPs, we provide you with a single endpoint to your assigned proxy list. With every request, the endpoint fetches a different IP. Please see the example below to learn how to use the endpoint as a proxy.
The vm.oxylabs.io domain is an example only. Contact your Account Manager to get a domain forwarded to you.
Proxy Rotator should be used only with port 60000.

Code examples

cURL
PHP
Python
C#
curl -x vm.oxylabs.io:60000 -U user1:pass1 https://ip.oxylabs.io/location
<?php
$username = 'user1';
$password = 'pass1';
$proxy = 'http://vm.oxylabs.io:60000';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "$username:$password");
$output = curl_exec($query);
curl_close($query);
if ($output) {
echo $output;
}
import requests
response = requests.get(
'https://ip.oxylabs.io/location',
proxies={'http': 'http://user1:[email protected]:60000',
'https': 'http://user1:[email protected]:60000'}
)
print(response.text)
using System;
using System.Net;
class Example
{
static void Main()
{
var client = new WebClient();
client.Proxy = new WebProxy("http://vm.oxylabs.io:60000");
client.Proxy.Credentials = new NetworkCredential("user1", "pass1");
Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
}
}

Session Control Using Proxy Rotator

It is possible to keep the same IP address with the Proxy Rotator. Firstly, you will need to know how many proxies your Proxy Rotator has. Then add the --proxy-header "Proxy-Server: sXXX" header to your request, where sXXX is the number of the proxy, for example, s5 or s2541.

Code examples

cURL
PHP
Python
C#
user1@machine:~$ curl -x vm.oxylabs.io:60000 -U user1:pass1 https://ip.oxylabs.io/location --proxy-header "Proxy-Server: s10"
1.2.30.40
user1@machine:~$ curl -x vm.oxylabs.io:60000 -U user1:pass1 https://ip.oxylabs.io/location --proxy-header "Proxy-Server: s10"
1.2.30.40
user1@machine:~$ curl -x vm.oxylabs.io:60000 -U user1:pass1 https://ip.oxylabs.io/location --proxy-header "Proxy-Server: s10"
1.2.30.40
<?php
$username = 'user1';
$password = 'pass1';
$proxy = 'http://vm.oxylabs.io:60000';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "$username:$password");
$headers = [
"Proxy-Server: s10",
];
curl_setopt($query, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec($query);
curl_close($query);
if ($output) {
echo $output;
}
import requests
headers = {
"Proxy-Server": "s10"
}
response = requests.get(
'https://ip.oxylabs.io/location',
proxies={'http': 'http://user1:[email protected]:60000',
'https': 'http://user1:[email protected]:60000'},
headers=headers
)
print(response.text)
using System;
using System.Net;
class Example
{
static void Main()
{
var client = new WebClient();
client.Proxy = new WebProxy("http://vm.oxylabs.io:60000");
client.Proxy.Credentials = new NetworkCredential("user1", "pass1");
client.Headers.Add("Proxy-Server", "s10");
Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
}
}