File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Resin 是一个外部代理池,支持正向代理与反向代理两种接入
3030* **WebSocket 代理例子**:同上配置,你要建立目标为 `wss://ws.example.com/chat` 的连接。客户端应当向 `ws://127.0.0.1:2260/my-token/Default/https/ws.example.com/chat` 拨号建立 WebSocket 连接,并携带请求头 `X-Resin-Account: Tom`。
3131
3232**正向代理调用规范:**
33- * Resin 通过 HTTP 代理的 Proxy Auth 认证信息来获取业务身份。认证凭证(Credentials)格式为:`Platform.Account:RESIN_TOKEN`。
33+ * Resin 通过 HTTP 代理的 Proxy Auth 认证信息来获取业务身份。认证凭证(Credentials)格式为:`Platform.Account:RESIN_TOKEN`。Resin 规范保证 Platform 与 RESIN_TOKEN 没有特殊字符。Resin 使用第一个 . 与最后一个 : 进行分割,因此 Account 可以包含特殊符号,包括 :.。
3434* 在配置客户端的网络请求库时,需自行从 `resin_url` 中拆分出「代理服务器地址」和「Token」。把代理地址设置为发请求的 Proxy,把 Token 和业务身份塞入代理认证信息。
3535* 例子:设 `resin_url` 为 `http://127.0.0.1:2260/my-token`。通过 curl 请求的示例如下:`curl -x http://127.0.0.1:2260 -U "Default.Tom:my-token" https://api.example.com/ip`。其中 `-x` 指定 `http://127.0.0.1:2260` 为代理服务器,`-U` 的用户名传入业务身份 `Default.Tom`,密码传入 Token `my-token`。
3636```
You can’t perform that action at this time.
0 commit comments