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

Thordata支持用戶在代理路由中設置state參數,通過指定州級行政區的住宅IP傳輸,實現精準定位。示例:country-us-state-alabama表示從美國亞拉巴馬州獲取代理。

以下是一組國家參數的示例組合:

国家-州
参数

美國加利福尼亞州

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