File tree Expand file tree Collapse file tree 2 files changed +117
-0
lines changed
Expand file tree Collapse file tree 2 files changed +117
-0
lines changed Original file line number Diff line number Diff line change @@ -125,3 +125,69 @@ VLESS 极简反向代理配置,和核心内部自带的的通用反向代理
125125` tag ` 为该反向代理的出站代理 tag. 使用路由将流量路由到该出站将会透过反向代理转发到连入的客户端路由系统中(客户端配置详见 VLESS 出站).
126126
127127当有多个不同的连接(可以来自不同的设备)接入时核心会对每个请求随机选择一条派发反向代理数据。
128+
129+ ** 完整极简配置案例**
130+
131+ 公网端配置一个 VLESS 入站,与 UUID 同级配置 ` "reverse": { "tag": "xxx" } ` ,此 tag 视为出站,把流量路由至此即可使用
132+
133+ ** 所以公网端一定要有一个默认出站比如 direct,不然会有某一个 reverse 成为默认出站、谁都能访问**
134+
135+ 方便演示这里用 [ VLESS Encryption] ( https://github.com/XTLS/Xray-core/pull/5067 ) ,实际上你直接过墙的话会用 [ REALITY] ( https://github.com/XTLS/Xray-core/pull/4915 ) ,当然你也可以用 [ tunnel] ( https://github.com/XTLS/Xray-core/pull/4968 ) 直接暴露内网端口到公网,也就是下面示例配置中直接访问公网的80端口即可访问到内网想要的地址。
136+
137+ ``` json-comments
138+ {
139+ "inbounds": [
140+ {
141+ "listen": "0.0.0.0",
142+ "port": 443,
143+ "protocol": "vless",
144+ "settings": {
145+ "decryption": "mlkem768x25519plus.native.600s.aCF82eKiK6g0DIbv0_nsjbHC4RyKCc9NRjl-X9lyi0k",
146+ "clients": [
147+ {
148+ "id": "ac04551d-6ebf-4685-86e2-17c12491f7f4", // for establishing reverse connection
149+ "flow": "xtls-rprx-vision",
150+ "reverse": {
151+ "tag": "r-outbound"
152+ }
153+ },
154+ {
155+ "id": "e8758aff-d830-4d08-a59e-271df65b995a", // for user
156+ "flow": "xtls-rprx-vision",
157+ "email": "user@example.com"
158+ }
159+ ]
160+ }
161+ },
162+ {
163+ "listen": "0.0.0.0",
164+ "port": 80,
165+ "protocol": "tunnel",
166+ "tag": "t-inbound"
167+ }
168+ ],
169+ "routing": {
170+ "rules": [
171+ {
172+ "user": [
173+ "user@example.com"
174+ ],
175+ "outboundTag": "r-outbound"
176+ },
177+ {
178+ "inboundTag": [
179+ "t-inbound"
180+ ],
181+ "outboundTag": "r-outbound"
182+ }
183+ ]
184+ },
185+ "outbounds": [
186+ {
187+ "protocol": "direct" // essential
188+ }
189+ ]
190+ }
191+ ```
192+
193+ 以上配置中的reverse和routing部分已经是完整配置,无须更改即可正常反向代理。
Original file line number Diff line number Diff line change @@ -119,3 +119,54 @@ VLESS 极简反向代理配置,和核心内部自带的的通用反向代理
119119` tag ` 为该反向代理的入站代理 tag. 当服务端派发反向代理请求时会从使用这个 tag 的入站进入路由系统,使用路由系统将其路由到你需要的出站。
120120
121121使用的 UUID 需要是服务端同样配置了 reverse 的 UUID(详见 VLESS 入站)。
122+
123+ ** 完整极简配置案例**
124+
125+ ** 内网端默认出站 direct 否则回环** ,另开一个 VLESS 出站配置 ` "reverse": { "tag": "yyy" } ` 就会自动连接公网端,无需配置路由
126+
127+ 此 tag 视为入站,可以在内网端的路由等处作为入站 tag 使用,并且它与公网端 reverse 的 tag 没有任何关系,可以不同
128+
129+ ``` json-comments
130+ {
131+ "outbounds": [
132+ {
133+ "protocol": "direct" // essential
134+ },
135+ {
136+ "protocol": "vless",
137+ "settings": {
138+ "address": "server.com",
139+ "port": 443,
140+ "encryption": "mlkem768x25519plus.native.0rtt.2PcBa3Yz0zBdt4p8-PkJMzx9hIj2Ve-UmrnmZRPnpRk",
141+ "id": "ac04551d-6ebf-4685-86e2-17c12491f7f4",
142+ "flow": "xtls-rprx-vision",
143+ "reverse": {
144+ "tag": "r-inbound"
145+ }
146+ }
147+ }
148+ ]
149+ }
150+ ```
151+
152+ ** 内网端可以设 CDN 等多条冗余线路均为 ` "reverse": { "tag": "yyy" } ` 对应公网端多个相同的 ` "reverse": { "tag": "xxx" } ` **
153+
154+ ### 安全注意事项
155+ 公网端可以给不同 id 设不同 reverse 穿透至不同的内网设备,** 客户端应当用新的 id,不然拿到客户端配置就能劫持你的反向代理**
156+
157+ 用于内网穿透的连接即使开了 XTLS Vision,也只是吃到了 padding,并没有裸奔,是否给用于使用的连接开 XTLS 裸奔自行分析
158+
159+ 内网端 direct 出站可以设置 redirect 以限制访问范围,或者你把默认出站设为 block,只路由允许访问的范围至 direct
160+
161+ 例如:你只想限制反向代理的目的地是内网设备 ` 127.0.0.1:8000 ` 这个地址,那就可以在内网端的直连出口添加以下配置
162+
163+ ``` json-comments
164+ {
165+ "protocol": "direct" // essential
166+ "settings": {
167+ "redirect": "127.0.0.1:8000"
168+ }
169+ }
170+ ```
171+
172+ ** 如果你在用别人提供的内网穿透服务或不信任 VPS,内网应开一个 VLESS Encryption 服务端承接流量,确保身份认证及数据安全**
You can’t perform that action at this time.
0 commit comments