-
Hi! I want to choose outbound connection by inbound port. I have this JSON for a server {
"inbounds": [
{
"protocol": "shadowsocks",
"port": "1455,1456",
"settings": {
"password": "somepass",
"method": "2022-blake3-chacha20-poly1305",
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "socks",
"tag": "tor",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 9050
}
]
}
},
{
"protocol": "freedom",
"tag": "direct"
}
],
"routing": {
"rules": [
{
"port": 1455,
"outboundTag": "direct"
},
{
"port": 1456,
"outboundTag": "tor"
}
]
}
} The idea is that when the traffic goes through 1455 inbound port it is forwarded to And the problem is that the traffic always goes through the first outbound in the array despite of the routing rules. So with this config it always goes through How can I fix this? Do I have a mistake in the config? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
in the current setup, no rule takes effect, so first outbound applies you are confusing "destination port of the user traffic" with "destination port of the vpn" if a user browses a website like instead, it is better to create two inbounds, one per port, and add |
Beta Was this translation helpful? Give feedback.
you need a route like
{"inboundTag": ["my-tag-on-inbound"], "outboundTag": "my-tag-on-outbound"}
I believe tags on inbound and outbound live in completely separate namespaces