代理轮换工具 - 可选
此服务是可选的,不包含在订购中。我们不会连接到单个 IP,而是为您分配的代理列表提供一个端点。每次请求,端点都会获取一个不同的 IP。请看下方示例,了解如何使用端点作为代理。
代理轮换工具应仅用于端口 60000
。
代码示例
curl -x vm.oxylabs.io:60000 -U user1:pass1 https://ip.oxylabs.io
<?php
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, 'http://vm.oxylabs.io:60000');
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',
proxies={'http': 'http://user1:pass1@vm.oxylabs.io:60000',
'https: http://user1:pass1@vm.oxylabs.io:60000'}
)
print(response.text)
using System;
using System.Net;
class Example
{
static void Main()
{
var proxy = new WebProxy
{
Address = new Uri($"http://vm.oxylabs.io:60000"),
BypassProxyOnLocal = false,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("username", "password")
};
var handler = new HttpClientHandler
{
Proxy = proxy,
};
HttpClient client = new HttpClient(handler);
var task = Task.Run(async () =>
{
var response = await client.GetAsync("https://ip.oxylabs.io/location");
var content = response.Content;
var result = await content.ReadAsStringAsync();
return result;
});
task.Wait();
Console.WriteLine(task.Result);
}
}
Last updated