wss
Converts a WebSocket request into a new wss request (the server will receive the converted WebSocket URL).
Only supports WebSocket requests
ws[s]://domain[:port]/[path][?query]
. Transformation tunneling proxies and regular HTTP/HTTPS are not supported.
Rule Syntax
txt
pattern wss://value [filters...]
Parameters | Description | Detailed Documentation |
---|---|---|
pattern | Expression to match WebSocket request URLs | Match Pattern Documentation |
value | Target URL format: domain[:port]/[path][?query] ⚠️ Loading data from files/remote URLs is not supported | Operation Instruction Documentation |
filters | Optional filters, supporting matching: • Request URL/Method/Headers/Content • Response Status Code/Headers | Filters Documentation |
WebSocket Transformation
txt
ws://www.example.com/path1 wss://www.test.com/path/xxx
wss://www.example.com/path2 wss://www.abc.com/path3/yyy
- Automatic path concatenation:
Original request Conversion result (URL received by the server) ws://www.example.com/path1
wss://www.test.com/path/xxx
ws://www.example.com/path1/a/b/c?query
wss://www.test.com/path/xxx/a/b/c?query
wss://www.example.com/path2
wss://www.abc.com/path3/yyy
wss://www.example.com/path2/a/b/c?query
wss://www.abc.com/path3/yyy/a/b/c?query
- Disable path concatenation: Use
< >
or()
to wrap the path.txtwww.example.com/path1 wss://<www.test.com/path/xxx> # www.example.com/path1 wss://(www.test.com/path/xxx)
Original Request Conversion Result (URL Received by the Server) [wss/ws]://www.example.com/path/x/y/z
wss://www.test.com/path/xxx
Only supports forwarding WebSocket requests; other requests match the wss
protocol. Result:
- Tunnel Proxy: Ignore matches
- Normal HTTP/HTTPS Request: Returns
502