Xray-core
Xray-core copied to clipboard
Is a reverse proxy what I need? 中文也行
Hi fellas
Some of my (client side) internet connections get really weak during peak hours. You know, if you happen to be on 方正 or 长城.
Instead of connecting directly to the server, I want to connect by proxying over a nearby 联通 connection. I have done this with other vpn software and it helps A LOT. I see that Xray supports reverse proxying which might be able to do what I want without using other software.
Can you help confirm first before I dive in, that using BridgeObject and PortalObject (like in the Reverse Proxy example) is the best way to allow traffic to first go over another connection?
I have a second question. If I want to DIRECT connect to the server abroad, can I connect to it even though it's assigned "bridge"? I hear that the "bridge" connects to the "portal" which is weird. I don't need that. Both my "portal" and my "bridge" have public IPs.
If the answer is "no" then can I run a "bridge" and normal "server" both on port 443 at the same time?
I just want my "client" to go to "portal" and then "portal" relays that to the "bridge". Is there a better and cleaner way to do it?
Thank you!
Maybe you can try dokodemo-door?
A "bridge" in this context is a component that actively establishes a connection to a portal (or port). It's like a gateway that forwards traffic from the public network to the internal server. The bridge receives public network traffic and forwards it unchanged to the web server in host A. It can also dynamically load balance according to the size of the traffic.
On the other hand, a "port" or "portal" is the entry point that receives connections. It receives two types of connections: one is the connection sent by the bridge, and the other is the connection sent by public network users. The portal's job is to automatically merge these two types of connections. the bridge is the component that sends the traffic, and the port or portal is the component that receives the traffic. Together, they enable the reverse proxy to function by forwarding traffic from the public network to the internal server.
{
"bridges": [
{
"tag": "bridgeA",
"domain": "example.com"
}
],
"outbounds": [
{
"tag": "out",
"protocol": "freedom",
"settings": {
"redirect": "127.0.0.1:80"
}
},
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "hostB_IP",
"port": 1024,
"users": [
{
"id": "your_uuid"
}
]
}
]
},
"tag": "interconn"
}
],
"routing": {
"rules": [
{
"type": "field",
"inboundTag": [
"bridgeA"
],
"domain": [
"full:example.com"
],
"outboundTag": "interconn"
},
{
"type": "field",
"inboundTag": [
"bridgeA"
],
"outboundTag": "out"
}
]
}
}
{
"portals": [
{
"tag": "portalB",
"domain": "example.com"
}
],
"inbounds": [
{
"tag": "external",
"port": 80,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"network": "tcp"
}
},
{
"port": 1024,
"tag": "interconn",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "your_uuid"
}
]
}
}
],
"routing": {
"rules": [
{
"type": "field",
"inboundTag": [
"external"
],
"outboundTag": "portalB"
},
{
"type": "field",
"inboundTag": [
"interconn"
],
"outboundTag": "portalB"
}
]
}
}
Thank you.
I solved it with iptables on an openwrt mips router. It forwards traffic for me. Works great.