州
Thordata支持用户在代理路由中设置state参数,通过指定州级行政区的住宅IP传输,实现精准定位。
示例:country-us-state-alabama表示从美国亚拉巴马州获取代理。
点击此处下载完整的州列表。
参数必须与country参数一起使用,单独使用state参数无法获取指定国家州的IP
以下是一些国家和州参数的示例组合:
国家-州
参数
美国加利福尼亚州
country-us-state-california:
英国英格兰
country-gb-state-england
泰国素林
country-th-state-surin
香港九龙城
country-hk-state-kowloonc
澳大利亚维多利亚
country-au-state-victoria
代码示例:
使用来自美国加利福尼亚州的随机IP地址对ipinfo.thordata.com执行查询
curl -x "https://td-customer-USERNAME-country-us-state-california:[email protected]:9999" "https://ipinfo.thordata.com"using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class csharp_http
{
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("http://t.na.thordata.net:9999")
{
UseDefaultCredentials = false,
Credentials = new NetworkCredential(
userName: "td-customer-USERNAME-country-us-state-california",
password: "PASSWORD")
};
var httpClientHandler = new HttpClientHandler()
{
Proxy = proxy,
};
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?