我們支持將IP精準至城市級定位,只需要使用city
參數。例如:region-US-city-houstonn
表示來自美國休斯頓的IP。
我們願意為全球範圍內的任何城市提供支持,但我們不保證在所有城市都設有代理。在大多數熱門城市中,我們的覆蓋率良好,並且提供了諸多代理選擇。
以下是一些城市參數的有效示例:
代碼示例:
使用來自美國華盛頓的隨機IP地址對ipinfo.thordata.com
執行查詢
curl -x t.pr.thordata.net:12233 -U "user-USERNAME-region-US-city-houston:PASSWORD" ipinfo.thordata.com
using System;
using System.Net;
class Example
{
static void Main()
{
var client = new WebClient();
client.Proxy = new WebProxy("t.pr.thordata.net:12233");
client.Proxy.Credentials = new NetworkCredential("user-USERNAME-region-US-city-houston", "PASSWORD");
Console.WriteLine(client.DownloadString("https://ipinfo.thordata.com"));
}
}
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'US';
$city = 'houston';
$proxy = 't.pr.thordata.net:12233';
$query = curl_init('https://ipinfo.thordata.com');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "user-$username-region-$country-city-$city:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'US'
city = 'houston'
entry = ('http://user-%s-region-%s-city-%s:%s@t.pr.thordata.net:12233' %
(username, country, city, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ipinfo.thordata.com').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("t.pr.thordata.net", 12233);
String query = Executor.newInstance()
.auth(entry, "user-USERNAME-region-US-city-houston", "PASS")
.execute(Request.Get("http://ipinfo.thordata.com").viaProxy(entry))
.returnContent().asString();
System.out.println(query);
}
}
require 'uri'
require 'net/http'
uri = URI.parse('https://ipinfo.thordata.com')
proxy = Net::HTTP::Proxy('t.pr.thordata.net', 12233, 'user-USERNAME-region-US-city-houston', 'PASSWORD')
req = Net::HTTP::Get.new(uri.path)
result = proxy.start(uri.host,uri.port) do |http|
http.request(req)
end
puts result.body