城市
Thordata用戶在代理路由中設置city參數,即可實現 IP 到目標城市的精確定位。例如:country-US-city-houston
點擊此處 下載完整城市列表。
我們支持全球任意城市,但無法保證所有城市均設有代理節點。在多數主要城市中,覆蓋良好且提供多個代理選項。
以下是一些城市參數的有效示例:
國家-城市
參數
德國-慕尼黑
country-DE-city-munich
印度-新德里
country-IN-city-delhi
泰國-曼谷
country-TH-city-bangkok
韓國-首爾
country-KR-city-seoul
日本-東京
country-JP-city-tokyo
代碼示例:
在此示例中,從美國海沃德的一個隨機IP地址執行對 ipinfo.thordata.com 的查詢:
curl -x "https://td-customer-USERNAME-country-us-city-hayward:[email protected]:9999" "https://ipinfo.thordata.com"using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
class csharp_https
{
static void Main(string[] args)
{
Task t = new Task(DownloadPageAsync);
t.Start();
Console.ReadLine();
}
static async void DownloadPageAsync()
{
string page = "https://ipinfo.thordata.com";
var proxy = new WebProxy("https://t.na.thordata.net:9999")
{
UseDefaultCredentials = false,
Credentials = new NetworkCredential(
userName: "td-customer-USERNAME-country-us-city-hayward",
password: "PASSWORD")
};
var httpClientHandler = new HttpClientHandler()
{
Proxy = proxy,
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);
var response = await client.GetAsync(page);
using (HttpContent content = response.Content)
{
string result = await content.ReadAsStringAsync();
Console.WriteLine(result);
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}Last updated
Was this helpful?