繁體中文

新功能

GitHub API 流量支援自訂閘道,身分驗證與網址維持直連

企業若需要稽核或集中管控網路流量,現在可以透過個別主機的 api_host 設定,將 GitHub API 請求導向自訂閘道(gateway,把流量轉去另一個位址再送出的中繼點)。這項改動只會轉發 API 呼叫,登入身分驗證、Git 遠端儲存庫操作與瀏覽器開啟網址仍會直接連線至原始主機。此功能目前仍處於實驗階段,且不是安全邊界,部分請求可能依然會送往原始主機。

# 設定將 github.com 的 API 流量轉發至自訂閘道
gh config set api_host gh-gateway.example.com --host github.com

# 查詢特定主機目前設定的 API 閘道位址
gh config get api_host --host github.com

English

FEATURE

GitHub API Traffic Supports Custom Gateways, While Authentication and URLs Remain Direct

Organizations that need to audit or centrally manage network traffic can now route GitHub API requests to a custom gateway via the per-host api_host setting. This change only forwards API calls; login authentication, Git remote repository operations, and browser-opened URLs still connect directly to the original host. This feature is currently experimental and is not a security boundary, so some requests may still reach the original host.

# Set up forwarding API traffic for github.com to a custom gateway
gh config set api_host gh-gateway.example.com --host github.com

# Query the currently configured API gateway address for a specific host
gh config get api_host --host github.com

原始 CHANGELOG

Original changelogGitHub API 流量支援自訂閘道,身分驗證與網址維持直連
## Experimental: Route GitHub API traffic through a custom host

Organizations can now route a GitHub host's API traffic through a gateway using the new per-host `api_host` configuration:

```shell
# Route API traffic for github.com through a gateway
gh config set api_host gh-gateway.example.com --host github.com

# Read the configured API host
gh config get api_host --host github.com
```

The original host remains in use for authentication, Git remotes, and browser URLs.

> [!NOTE]
> `api_host` is experimental and is not a security boundary. Requests may still reach the original host.