城市
我们支持将IP精准至城市级定位,只需要使用city参数。例如:country-US-city-houston表示来自美国休斯顿的IP。
点击此处下载完整的城市列表。
我们愿意为全球范围内的任何城市提供支持,但我们不保证在所有城市都设有代理。在大多数热门城市中,我们的覆盖率良好,并且提供了诸多代理选择。
以下是一些城市参数的有效示例:
国家-城市
国家-城市参数
德国-慕尼黑
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 t.pr.thordata.net:9999 -U "td-customer-USERNAME-country-US-city-houston:PASSWORD" ipinfo.thordata.comusing 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_region
{
static void Main(string[] args)
{
Task t = new Task(DownloadPageAsync);
t.Start();
Console.ReadLine();
}
static async void DownloadPageAsync()
{
string page = "https://ipinfo.thordata.com";
String username = "username";
String password = "password";
String country = "us";
String city = "houston";
String proxyUserName = $"td-customer-{username}-country-{country}-city-{city}";
var proxy = new WebProxy("http://t.pr.thordata.net:9999")
{
UseDefaultCredentials = false,
Credentials = new NetworkCredential(
userName: proxyUserName,
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