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

國家/地區

Thordata支持用戶在代理路由中設定country參數,指定國家/地區的住宅IP進行傳輸。參數值採用3166-1 alpha-2雙字母國家代碼(不區分大小寫),例如:US美國代理、GB英國代理、VN越南代理。更多信息請參考下方示例。

以下是幾個國家參數的範例:

國家/地區
國家/地區參數

德國

country-DE

印度

country-IN

泰國

country-TH

韓國

country-KR

日本

country-JP

代碼示例:

使用來自美國的隨機IP地址執行對ipinfo.thordata.com的查詢:

curl -x "https://td-customer-USERNAME-country-us:PASSWORD@t.eu.thordata.net: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",
                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