选择州
Last updated
Last updated
住宅 移动 轮换 ISP
要从特定的美国州获取代理,请将 st
标志添加到授权字符串。For example, us_california
, us_illinois
.点击此处下载支持的美国各州名单(TXT 格式)。
在以下示例中,从美国加州的一个随机 IP 地址执行对 ipinfo.io
的查询:
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-st-us_california:PASSWORD" https://ipinfo.io
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$state = 'us_california';
$proxy = 'pr.oxylabs.io:7777';
$query = curl_init('https://ipinfo.io');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-st-$state:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
state = 'us_california'
entry = ('http://customer-%s-st-%s:%s@pr.oxylabs.io:7777' %
(username, state, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ipinfo.io').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("pr.oxylabs.io", 7777);
String query = Executor.newInstance()
.auth(entry, "customer-USERNAME-st-us_california", "PASS")
.execute(Request.Get("http://icanhazip.com").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("pr.oxylabs.io:7777");
client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-st-us_california", "PASSWORD");
Console.WriteLine(client.DownloadString("https://ipinfo.io"));
}
}
require 'uri'
require 'net/http'
uri = URI.parse('https://ipinfo.io/')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-st-us_california', 'PASSWORD')
req = Net::HTTP::Get.new(uri.path)
result = proxy.start(uri.host,uri.port) do |http|
http.request(req)
end