> For the complete documentation index, see [llms.txt](https://docs.talordata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talordata.com/cn-tw/proxy/mobile-proxies/advanced-features/protocols.md).

# 協定

您的使用場景決定了最適合的協定。以下 cURL 範例可協助您在整合代理前驗證連線是否正常。

{% hint style="warning" icon="lightbulb-exclamation-on" %}
所有範例中的 <mark style="color:$primary;">`username:password@host:port`</mark> 僅為佔位符，請務必替換為您的真實代理憑證，否則測試將失敗
{% endhint %}

***

### HTTP

適用於大多數日常使用場景，無需加密連線時選擇此協定。

```http
curl -x http://username:password@host:port https://ipinfo.io
```

### HTTPS

當您需要客戶端與代理伺服器之間的連線加密時，使用HTTPS協定。

```http
curl -x https://username:password@host:port https://ipinfo.io
```

### SOCKS5

通用代理協定，適合聊天應用、遊戲客戶端等非HTTP程式。

```http
curl -x socks5h://username:password@host:port https://ipinfo.io
```

{% hint style="warning" icon="lightbulb-exclamation-on" %} <mark style="color:$primary;">`socks5h`</mark> 中的 <mark style="color:$primary;">`h`</mark> 強制主機名稱在代理伺服器端解析，提高隱私性
{% endhint %}

***

### 驗證代理

上述命令成功執行時，`ipinfo.io` 會回傳請求來源的 IP 位址及其他資訊。

**輸出範例：**

```http
{
  "ip": "173.44.168.103",
  "city": "Houston",
  "region": "Texas",
  "country": "US",
  "loc": "29.7633,-95.3633",
  "org": "AS174 Cogent Communications, LLC",
  "postal": "77002",
  "timezone": "America/Chicago",
  "readme": "https://ipinfo.io/missingauth"
}
```
