Skip to content

Commit ffac880

Browse files
committed
docs: add WebSocket support to README
1 parent 5e00a8e commit ffac880

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
- HTTPS certificate handling is compatible with [mitmproxy](https://mitmproxy.org/) and stored in the `~/.mitmproxy` folder. If the root certificate is already trusted from a previous use of `mitmproxy`, `go-mitmproxy` can use it directly.
2222
- Map Remote and Map Local support.
2323
- HTTP/2 support.
24+
- WebSocket support.
2425
- Refer to the [configuration documentation](#additional-parameters) for more features.
2526

2627
## Unsupported features
2728

2829
- Only supports setting the proxy manually in the client, not transparent proxy mode.
29-
- Currently does not support WebSocket protocol parsing.
3030

3131
> For more information on the difference between manually setting a proxy and transparent proxy mode, please refer to the mitmproxy documentation for the Python version: [How mitmproxy works](https://docs.mitmproxy.org/stable/concepts-howmitmproxyworks/). go-mitmproxy currently supports "Explicit HTTP" and "Explicit HTTPS" as mentioned in the article.
3232
@@ -158,6 +158,21 @@ type Addon interface {
158158

159159
// Stream response body modifier
160160
StreamResponseModifier(*Flow, io.Reader) io.Reader
161+
162+
// WebSocket connection established
163+
WebSocketStart(*Flow)
164+
165+
// WebSocket message received
166+
WebSocketMessage(*Flow)
167+
168+
// WebSocket connection closed
169+
WebSocketEnd(*Flow)
170+
171+
// HTTP request failed with error
172+
RequestError(*Flow, error)
173+
174+
// HTTP CONNECT request failed with error
175+
HTTPConnectError(*Flow, error)
161176
}
162177
```
163178

README_CN.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
- HTTPS 证书相关逻辑与 [mitmproxy](https://mitmproxy.org/) 兼容,并保存在 `~/.mitmproxy` 文件夹中。如果之前已经用过 `mitmproxy` 并安装信任了根证书,则 `go-mitmproxy` 可以直接使用。
2222
- 支持 Map Remote 和 Map Local。
2323
- 支持 HTTP/2
24+
- 支持 WebSocket 协议解析。
2425
- 更多功能请参考[配置文档](#更多参数)
2526

2627
## 暂未实现的功能
2728

2829
- 只支持客户端显示设置代理,不支持透明代理模式。
29-
- 暂不支持 websocket 协议解析。
3030

3131
> 如需了解显示设置代理和透明代理模式的区别,请参考 Python 版本的 mitmproxy 文档:[How mitmproxy works](https://docs.mitmproxy.org/stable/concepts-howmitmproxyworks/)`go-mitmproxy` 目前支持文中提到的『Explicit HTTP』和『Explicit HTTPS』。
3232
@@ -158,6 +158,21 @@ type Addon interface {
158158

159159
// 流式响应体修改器
160160
StreamResponseModifier(*Flow, io.Reader) io.Reader
161+
162+
// WebSocket 连接建立
163+
WebSocketStart(*Flow)
164+
165+
// WebSocket 消息接收
166+
WebSocketMessage(*Flow)
167+
168+
// WebSocket 连接关闭
169+
WebSocketEnd(*Flow)
170+
171+
// HTTP 请求失败
172+
RequestError(*Flow, error)
173+
174+
// HTTP CONNECT 请求失败
175+
HTTPConnectError(*Flow, error)
161176
}
162177
```
163178

0 commit comments

Comments
 (0)