⚠️ Please help to do this 🙏 - route to Multi outbounds by value of "Host" in request header 🙏 #2322
hosein-moayedi
started this conversation in
General
Replies: 1 comment 1 reply
-
Hello, can I need your Telegram or WhatsApp ID? I need a guide on how to create this file |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys!
I want to do this and I know this should be work but I very tried to do this and failed!
env:
1 Iran server --- turbo.mydomain.site,
1 Germany server --- vpn.mydomain.site,
1 Finlond server --- fl.mydomain.site
desc:
I want to give 2 vless configs to the client from the iran server with define one inbound inside of the iran server and all info of these two configs is same, like address, port, type, etc.. and there is just one thing that is differents. that is value of "Host" parameter on request header in WS or TCP that is the domain of my target server that iran server should route all client traffic to that target server.
ex: if the user selected config 1 with address: "turbo.mydomain.site" and "Host"="fl.mydomain.site", he should connect to Iran server and rout to Finlond server through outbound of Finland that I defined in iran outbounds array.
This is example of my client config:
vless://81c78225-9470-44fb-9e79-e4137b9eb60d@turbo.mydomain.site:443?type=tcp&path=%2F&host=fl.mydomain.site&headerType=http&security=none#VPN-409431573-169224425
This is Xray config file of my IRAN server but not working true, and all traffics is routed trough first index of outbounds array (germany server).
I also tested "domainStrategy"="IPIfNonMatch" but not working! 😢
What is the problem??
Please help me 🙏
{
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
}
],
"log": {
"access": "./access.log",
"error": "./error.log",
"loglevel": "warning"
},
"outbounds": [
{
"tag": "germany",
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "vpn.mydomain.site",
"port": 334,
"users": [
{
"id": "390e5224-7822-4136-955b-fe95384542cc",
"alterId": 0,
"email": "t@t.tt",
"security": "auto",
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/",
"headers": {}
}
}
},
{
"tag": "finland",
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "fl.mydomain.site",
"port": 334,
"users": [
{
"id": "390e5224-7822-4136-955b-fe95384542cc",
"alterId": 0,
"email": "t@t.tt",
"security": "auto",
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/",
"headers": {}
}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
}
}
],
"policy": {
"levels": {
"0": {
"statsUserDownlink": true,
"statsUserUplink": true
}
},
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true
}
},
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"ip": [
"geoip:private"
],
"outboundTag": "blocked",
"type": "field"
},
{
"type": "field",
"outboundTag": "blocked",
"domain": [
"geosite:category-ads-all",
"ext:iran.dat:ads"
]
},
{
"type": "field",
"domain": [
"fl.mydomain.site"
],
"outboundTag": "finland"
},
{
"type": "field",
"domain": [
"vpn.mydomain.site"
],
"outboundTag": "germany"
},
{
"type": "field",
"domain": [
"skyroom.online"
],
"outboundTag": "direct"
},
{
"type": "field",
"inboundTag": [
"api"
],
"outboundTag": "direct"
}
]
},
"stats": {}
}
Beta Was this translation helpful? Give feedback.
All reactions