mirror of
https://github.com/apernet/OpenGFW.git
synced 2024-11-11 04:49:22 +08:00
docs: add sock4/4a doc
This commit is contained in:
parent
96716561e0
commit
1ae0455fd5
@ -269,6 +269,57 @@ Example for blocking Trojan connections:
|
||||
expr: trojan != nil && trojan.yes
|
||||
```
|
||||
|
||||
## SOCKS4/SOCKS4A
|
||||
|
||||
SOCKS4:
|
||||
|
||||
```json5
|
||||
{
|
||||
"socks4": {
|
||||
"req": {
|
||||
"cmd": 1, // 0x01: connect, 0x02: bind
|
||||
"ip": "1.1.1.1",
|
||||
"port": 443,
|
||||
"user_id": "user_id"
|
||||
},
|
||||
"resp": {
|
||||
"rep": 90, // 0x5A(90): granted
|
||||
"ip": "1.1.1.1",
|
||||
"port": 443
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
SOCKS4A:
|
||||
|
||||
```json5
|
||||
{
|
||||
"socks4": {
|
||||
"req": {
|
||||
"cmd": 1, // 0x01: connect, 0x02: bind
|
||||
"ip": "0.0.0.1",
|
||||
"port": 443,
|
||||
"user_id": "user_id",
|
||||
"hostname": "google.com"
|
||||
},
|
||||
"resp": {
|
||||
"rep": 90, // 0x5A(90): granted
|
||||
"ip": "0.0.0.1",
|
||||
"port": 443
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Example for blocking connections to `google.com:80`:
|
||||
|
||||
```yaml
|
||||
- name: block baidu socks
|
||||
action: block
|
||||
expr: string(socks4?.req?.hostname) endsWith "bilibili.com" && socks4?.req?.port == 80
|
||||
```
|
||||
|
||||
## SOCKS5
|
||||
|
||||
SOCKS5 without auth:
|
||||
|
Loading…
Reference in New Issue
Block a user