Oxylabs Documentation
中文
搜索
K

选择国家/地区

Oxylabs 动态数据中心代理目前提供 8 个不同的国家可供选择。具体国家/地区的随机代理入口点为每个新请求返回新的 IP。
这些是可供选择的国家/地区:
美国 dc.us-pr.oxylabs.io:30000
德国 dc.de-pr.oxylabs.io:40000
法国 dc.fr-pr.oxylabs.io:42000
荷兰 dc.nl-pr.oxylabs.io:44000
英国 dc.gb-pr.oxylabs.io:46000
罗马尼亚 dc.ro-pr.oxylabs.io:48000
日本 dc.jp-pr.oxylabs.io:12000
加拿大 dc.ca-pr.oxylabs.io:34000

代码示例

在以下示例中,从德国的一个随机 IP 地址执行对 ip.oxylabs.io 的查询:
cURL
PHP
Python
Java
C#
Ruby
curl -x dc.de-pr.oxylabs.io:40000 -U "customer-USERNAME:PASSWORD" https://ip.oxylabs.io/location
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$proxy = 'dc.de-pr.oxylabs.io:40000';
$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, "customer-$username:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
entry = ('http://customer-%s:%[email protected]:40000' %
(username, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())
package example;
import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;
public class Example {
public static void main(String[] args) throws Exception {
HttpHost entry = new HttpHost("dc.de-pr.oxylabs.io", 40000);
String query = Executor.newInstance()
.auth(entry, "customer-USERNAME", "PASS")
.execute(Request.Get("https://ip.oxylabs.io/location").viaProxy(entry))
.returnContent().asString();
System.out.println(query);
}
}
using System;
using System.Net;
class Example
{
static void Main()
{
var client = new WebClient();
client.Proxy = new WebProxy("dc.de-pr.oxylabs.io:40000");
client.Proxy.Credentials = new NetworkCredential("customer-USERNAME", "PASSWORD");
Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
}
}
require 'uri'
require 'net/http'
uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('dc.de-pr.oxylabs.io', 40000, 'customer-USERNAME', 'PASSWORD')
req = Net::HTTP::Get.new(uri.path)
result = proxy.start(uri.host,uri.port) do |http|
http.request(req)
end
puts result.body

可用入口点

dc.pr.oxylabs.io:10000
dc.jp-pr.oxylabs.io:12000
dc.us-pr.oxylabs.io:30000
dc.ca-pr.oxylabs.io:34000
dc.de-pr.oxylabs.io:40000
dc.fr-pr.oxylabs.io:42000
dc.nl-pr.oxylabs.io:44000
dc.gb-pr.oxylabs.io:46000
dc.ro-pr.oxylabs.io:48000