Skip to content

Commit 124efa3

Browse files
authored
feat: support websocket (#15)
* feat: proxy websocket * add ui for view websocket messages * update readme and fix typo * improve index.html * optimize variable names of handle_websocket
1 parent fe175c9 commit 124efa3

File tree

9 files changed

+720
-161
lines changed

9 files changed

+720
-161
lines changed

Cargo.lock

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ http-body-util = "0.1"
2525
hyper = { version = "1.0", features = ["full"] }
2626
hyper-rustls = { version = "0.26.0", default-features = false, features = ["webpki-roots", "webpki-tokio", "ring", "http1", "http2", "tls12"] }
2727
hyper-util = { version = "0.1", features = ["server-auto", "client-legacy"] }
28+
hyper-tungstenite = "0.13.0"
2829
indexmap = { version = "2.2.5", features = ["serde"] }
2930
moka = { version = "0.12.5", features = ["future"] }
3031
pin-project-lite = "0.2.13"
@@ -40,6 +41,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "net", "macros", "fs", "
4041
tokio-util = { version = "0.7", features = ["io-util", "compat"] }
4142
tokio-rustls = "0.25.0"
4243
tokio-stream = { version = "0.1.14", default-features = false, features = ["sync"] }
44+
tokio-tungstenite = { version = "0.21.0", features = ["rustls-tls-webpki-roots"] }
4345
url = "2.5.0"
4446

4547
[dev-dependencies]

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
[![CI](https://github.com/sigoden/proxyfor/actions/workflows/ci.yaml/badge.svg)](https://github.com/sigoden/proxyfor/actions/workflows/ci.yaml)
44
[![Crates](https://img.shields.io/crates/v/proxyfor.svg)](https://crates.io/crates/proxyfor)
55

6-
A simple and portable proxy for capturing HTTP and HTTPS traffic.
6+
A lightweight proxy for monitoring HTTP, HTTPS, and WebSocket traffic.
77

88
## Features
99

1010
- Support forward proxy
1111
- Support reverse proxy
1212
- Support filtering
13-
- Integrate web inteface
13+
- Support HTTP/HTTPS/WS/WSS protocols
14+
- Integrate web interface
1415
- Integrate certificates installation webapp
1516
- Export in Markdown, cURL, or HAR formats
1617

@@ -84,7 +85,7 @@ proxyfor -l 127.0.0.1
8485
proxyfor -l 127.0.0.1:18080
8586
```
8687

87-
Enable web inteface with `-w/--web`
88+
Enable web interface with `-w/--web`
8889

8990
```sh
9091
proxyfor --web

0 commit comments

Comments
 (0)