chika0801 / Xray-examples

Xray 配置示例
https://github.com/XTLS/Xray-core
506 stars 97 forks source link

Inquiry on Setting Up Reverse Tunneling with VLESS TCP #18

Closed us254 closed 9 months ago

us254 commented 9 months ago

Hello Chika0801,

I have past experience with setting up SSH for reverse tunneling, and I'm currently exploring how to configure reverse tunneling using the VLESS TCP protocol. Could you please provide me with guidance or the necessary steps to properly set up this configuration?

Thank you for your help.

chika0801 commented 9 months ago

This aspect of reverse proxying that you are talking about, I don't use it myself, I don't have experience with it.

chise0713 commented 9 months ago

Here's a example.

server ```jsonc { "log": { "loglevel": "warring" }, "inbounds": [ { "tag": "Hello", "port": 721, "protocol": "dokodemo-door", "settings": { "address": "172.28.16.2", "port": 721, "network": "tcp" } }, { "listen": "172.28.16.1", "port": 443, "tag": "trojan", "protocol": "trojan", "settings": { "clients": [ { "password": "123456789", "level": 0 } ] } } ], "outbounds": [ // for safety { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "block" }, { "tag": "direct", "protocol": "freedom", "settings": { "domainStrategy": "AsIs" } } ], "reverse": { "portals": [ { "tag": "portal", "domain": "reverse.itsadomain.com" } ] }, "routing": { "rules": [ { "type": "field", "inboundTag": [ "Hello" ], "outboundTag": "portal" }, "inboundTag": [ "trojan" ], "domain": [ "full:reverse.itsadomain.com" ], "outboundTag": "portal" } ] } } ```
client: ```jsonc { "log": { "loglevel": "info" }, "outbounds": [ { "tag": "OutSide", "protocol": "trojan", "settings": { "servers": [ { "address": "172.28.16.1", "port": 443, "password": "123456789" } ] } } }, { "tag": "direct", "protocol": "freedom", "settings": { "domainStrategy": "AsIs" } } ], "reverse": { "bridges": [ { "tag": "bridge", "domain": "reverse.itsadomain.com" } ] }, "routing": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "inboundTag": [ "bridge" ], "domain": [ "full:reverse.itsadomain.com" ], "outboundTag": "OutSide" }, { "type": "field", "inboundTag": [ "bridge" ], "outboundTag": "direct" } ] } } ```

Different from frp, you need to config reverse inbound at server side.

chika0801 commented 9 months ago

https://github.com/XTLS/Xray-examples/tree/main/ReverseProxy

I think I remember that the official Xray configuration example is also available, so you can see for yourself.