For the complete documentation index, see llms.txt. This page is also available as Markdown.

城市

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:PASSWORD@t.thordata.online: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.thordata.online: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