-
Notifications
You must be signed in to change notification settings - Fork 16
Example setup with V2Ray
Shawn edited this page Sep 20, 2024
·
3 revisions
This section provides an example setup with all UDP and TCP redirection. The V2Ray config:
{
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "<your-server-addr>",
"port": <your-server-port>,
"security": "auto",
"users": [
{
"alterId": ...,
"id": "..."
}
]
}
],
},
"streamSettings": {
"network": "tcp"
},
}
],
"inbounds": [
{
"listen": "127.0.0.1",
"port": 1082,
"protocol": "dokodemo-door",
"settings": {
"followRedirect": true,
"network": "tcp,udp"
},
"sniffing": {
"destOverride": [
"http",
"tls"
],
"enabled": true,
"streamSettings": {
"sockopt": {
"tproxy": "tproxy"
}
}
}
}
]
}
Then profit with:
sudo cproxy --port 1082 --mode tproxy -- <your-program> --arg1 --arg2 ...
This section provides an example setup with DNS and TCP redirection. With the following V2Ray config, you can proxy your program's DNS requests with 1.1.1.1 as the DNS server, and proxy all TCP connections.
V2Ray config:
{
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "<your-server-addr>",
"port": <your-server-port>,
"security": "auto",
"users": [
{
"alterId": ...,
"id": "..."
}
]
}
],
"domainStrategy": "UseIP"
},
"streamSettings": {
"network": "tcp"
},
"tag": "out"
},
{
"protocol": "dns",
"settings": {
"network": "udp",
"address": "1.1.1.1",
"port": 53
},
"tag": "dns-out"
}
],
"dns": {
"servers": [
"1.1.1.1"
]
},
"routing": {
"rules": [
{
"port": 1082,
"network": "udp",
"inboundTag": [
"transparent"
],
"outboundTag": "dns-out",
"type": "field"
}
]
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 1082,
"protocol": "dokodemo-door",
"settings": {
"followRedirect": true,
"network": "tcp,udp"
},
"sniffing": {
"destOverride": [
"http",
"tls"
],
"enabled": true
},
"tag": "transparent"
}
]
}
Then profit with:
sudo cproxy --port 1082 -- <your-program> --arg1 --arg2 ...