-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xray VLESS-TCP-Reality + xtls-rprx-vision +nginx stream 443 sni 分流端口复用 + Proxy Protocol 访客IP是127.0.0.1 #1697
Comments
你的注释中存在很多错误, |
发下nginx 完整配置,猜是 log_format main 里面的 $remote_addr或写成$proxy_protocol_addr 另外排版弄好点吧 |
客户端用 Client Hello 中 服务端用配置中的 以上就是配置中 |
好的,多谢大佬指点,我不是搞开发的,对publicKey 的理解只剩下验证阻止中间人攻击了,这个配置是没有出官方模板前群里套用的,可能有的地方理解有误 |
学到了,Short ID 我还是要填下了 |
nginx.conf配置文件,不过我上面有提及,相同配置老的xtls是可以获取访客IP的: user nginx; error_log /var/log/nginx/error.log notice; events { http {
} stream模块设置stream { log_format proxy '$proxy_protocol_addr [$time_local] '
map $ssl_preread_server_name $stream_map { xtls.test vless; } upstream vless { upstream real { } stream模块监听443端口,并进行端口复用server { } } |
你的问题是nginx日志还是xray日志,哪个不能得到访问者的ip? |
"tcpSettings": { 如果是xray日志报访问者127.0.0.1 "sockopt": {
} 你去文档搜下加上面的参数 |
xray reality服务器端日志访客IP是127.0.0.1,用老的xtls搭建服务器有访客真实IP;
|
测试了你说的:
"tcpcongestion": "bbr", 2023/02/23 05:20:09 127.0.0.1:47288 accepted tcp:update.googleapis.com:443 [VLESS-TCP-Reality -> block] |
你说清楚 xray日志 的 127.0.0.1 ,那你等开发者试试。我不用SNI分流,没测试过。 建议你把 nginx 和 xray 的配置 完整的,整理好,发上来,方便开发者定位复现别人测试,注意下排版 |
还有,REALITY 的原理不是“偷证书”,TLSv1.3 把 Server Hello 后的消息全加密了,中间人看不到证书,想象力需要再丰富些 REALITY 服务端只偷了目标网站的 Server Hello,和后续握手消息的长度特征, |
仔细看了一下这个 issue, |
Xray 1.7.5 (Xray, Penetrates Everything.) 4d5c319 (go1.20.1 linux/amd64) |
有没有格式化的配置文件,准备抄个作业,谢谢
…On Thu, Feb 23, 2023 at 2:26 PM heygo ***@***.***> wrote:
仔细看了一下这个 issue,有可能是 REALITY 服务端代码的问题,你开一下服务端的 show 看看有没有真实 IP
测试了,确实可以看到访客IP了,我xxxx脱敏了
Xray 1.7.5 (Xray, Penetrates Everything.) 4d5c319
<4d5c319>
(go1.20.1 linux/amd64)
A unified platform for anti-censorship.
2023/02/23 06:19:32 [Info] infra/conf/serial: Reading config:
/etc/xray/config.json
2023/02/23 06:19:33 [Warning] transport/internet/tcp: accepting PROXY
protocol
2023/02/23 06:19:33 [Warning] core: Xray 1.7.5 started
REALITY remoteAddr: xxxxx:40380
REALITY remoteAddr: xxxx:40383
REALITY remoteAddr: xxxxx:40380 hs.clientHello.sessionId: [207 10 49 87
145 57 61]
—
Reply to this email directly, view it on GitHub
<#1697 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJN3ALX4GW4B6V5F46TPZ3WY37JRANCNFSM6AAAAAAVFBTTMU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@heygo1345678 OK,那我猜对了,v1.8.0 前会修复 |
已修复,请测试 bdbca33 |
大佬,SNI分流问题没有完美解决。使用此版本后反而不能使用SNI分流+Proxy Protocol了,必须去除Proxy Protocol才能正常使用。 |
|
感谢大佬,新更新完美修复了。 |
有完整配置参考下吗 谢谢
…On Sun, Feb 26, 2023 at 19:54 lxhao61 ***@***.***> wrote:
已修复,请测试 bdbca33
<bdbca33>
大佬,SNI分流问题没有解决,使用此版本后反而不能使用SNI分流+Proxy Protocol了,必须去除Proxy Protocol才能正常使用。
#1712 (comment)
<#1712 (comment)>
感谢大佬,新更新完美修复了。
—
Reply to this email directly, view it on GitHub
<#1697 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJN3AMFW632CX52XHE6EVLWZNAA5ANCNFSM6AAAAAAVFBTTMU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
等你更新配置大全 |
问题吐槽虽然这是一个已经关闭的issue,但我刚好看到了,我实在是看不过去这种提问格式,因为我已经看到过n次这种直接粘配置上来不整理格式的情况了。 我真的难以想象一个能搭建出“ xray VLESS-TCP-Reality + xtls-rprx-vision +nginx stream 443 sni 分流端口复用”的人,竟然连三个反引号引住代码区块都不会(又或者是懒?),粘出来的配置文件格式💩一样的难看,我要是rprx,看到这种回复我都不想回答,整理一下格式很难吗? 不敢说让你们去折叠代码了,就连基本的用一对 所以我写了这个教程,如果有人再遇到这样直接把配置文件粘上来不整理格式的,先把我这个教程给他看,让他重新编辑好格式再来问。 配置文件格式化教学1、如果你的配置文件写的时候就格式不整齐,首先要格式化一下,可以在网上找格式化工具:json格式化网站;
基于以上两个原因,所以我推荐用编辑器来格式化,我推荐用Visual Studio Code(平时简称vscode)编辑器
2、然后在gihub issue区域先敲一对三反引号(
3、写完后,点击左上角的“Preview”预览一下再发,预览格式没问题再发,有问题继续修改 我们来看看格式化后的配置文件,多清晰 {
"log": {
"loglevel": "warning"
},
"inbounds": [{
"tag": "VLESS-TCP-Reality",
"listen": "0.0.0.0",
"port": 44443, //服务器监听端口号,可以不是443,防火墙打开或者vps面板操作:iptables -I INPUT -p tcp --dport 8443 -j ACCEPT
"protocol": "vless",
"settings": {
"clients": [{
"id": "",
"flow": "xtls-rprx-vision" //解决tls in tls流量特征
}],
"decryption": "none"
},
"streamSettings": {
"tcpSettings": {
"acceptProxyProtocol": true
},
"network": "tcp",
"security": "reality", //魔改的tls协议 reality
"realitySettings": {
"show": false,
"privateKey": "", //使用上面生成的私钥
"shortIds": [""],
"Dest": "61.147.219.124:443", //这个是sni白名单网站www.microsoft.com的cdn IP和 https网站端口号
"type": "tcp",
"serverNames": ["www.microsoft.com"]
}
}
}],
"outbounds": [{
"protocol": "freedom",
"tag": "direct"
}]
} 折叠过长配置文件或日志当配置文件或粘贴上来的日志过长时,如果不折叠,看起来比较麻烦,此时你可以使用github markdown独有的折叠功能。 折叠的语法如下,你只需要把这个粘贴到你的issue中,然后把你要折叠的内容放在下面的内容区域,内容本身如果是配置文件,还是要加
我们来试试,把以下内容粘贴到issue中,然后点击“Preview”按钮预览一下
如下所示,可以看到虽然我们的配置文件内容挺长,但实际显示时就显示成一个按钮了,我们可以点击它来展开查看,看完又可以收起,这样可以让我们看issue时结构分明,等要看具体配置的时候才展开来看 server端配置{
"log": {
"loglevel": "warning"
},
"inbounds": [{
"tag": "VLESS-TCP-Reality",
"listen": "0.0.0.0",
"port": 44443, //服务器监听端口号,可以不是443,防火墙打开或者vps面板操作:iptables -I INPUT -p tcp --dport 8443 -j ACCEPT
"protocol": "vless",
"settings": {
"clients": [{
"id": "",
"flow": "xtls-rprx-vision" //解决tls in tls流量特征
}],
"decryption": "none"
},
"streamSettings": {
"tcpSettings": {
"acceptProxyProtocol": true
},
"network": "tcp",
"security": "reality", //魔改的tls协议 reality
"realitySettings": {
"show": false,
"privateKey": "", //使用上面生成的私钥
"shortIds": [""],
"Dest": "61.147.219.124:443", //这个是sni白名单网站www.microsoft.com的cdn IP和 https网站端口号
"type": "tcp",
"serverNames": ["www.microsoft.com"]
}
}
}],
"outbounds": [{
"protocol": "freedom",
"tag": "direct"
}]
} 希望大家提issue都能这么提,不求全部用折叠,但至少用一对 |
日志:2023/02/23 01:52:46 127.0.0.1:52556 accepted tcp:github.githubassets.com:443 [VLESS-TCP-Reality >> direct]
nginx stream 配置:
map $ssl_preread_server_name $stream_map {
xtls.test vless;
www.microsoft.com real;
}
upstream vless {
server 127.0.0.1:8443;
}
upstream real {
server 127.0.0.1:44443 ;
}
stream模块监听443端口,并进行端口复用
server {
listen 443 reuseport ;
listen [::]:443 reuseport ;
proxy_pass $stream_map;
ssl_preread on;
proxy_protocol on; # 开启Proxy protocol
}
}
reality版本:
xray version
Xray 1.7.5 (Xray, Penetrates Everything.) 4d5c319 (go1.20.1 linux/amd64)
A unified platform for anti-censorship.
reality服务器配置文件:
{
"log": {
"loglevel": "warning"
},
"tag": "VLESS-TCP-Reality",
"listen": "0.0.0.0",
"port": 44443, //服务器监听端口号,可以不是443,防火墙打开或者vps面板操作:iptables -I INPUT -p tcp --dport 8443 -j ACCEPT
"protocol": "vless",
"settings": {
"clients": [
{
"id": "",
"flow": "xtls-rprx-vision" //解决tls in tls流量特征
}
],
"decryption": "none"
},
"streamSettings": {
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}
客户端配置:
{
"log": {
"loglevel": "warning"
},
}
]
}
相同的action build版本,用老的xtls是可以获取访客IP的:
2023/02/23 01:51:52 [Warning] infra/conf: You are using an old version of XTLS, which is deprecated now and will be removed soon. Please use flow "xtls-rprx-vision" with "tls & tlsSettings" instead.
2023/02/23 01:51:52 [Warning] transport/internet/websocket: accepting PROXY protocol
2023/02/23 01:51:52 [Warning] core: Xray 1.7.5 started
2023/02/23 01:51:53 234.12.31.12:38640 accepted tcp:149.12.1.100:80
nginx stream配置同上;
xray配置文件:
{
"log": {
},
"inbounds": [
{
"port": 8443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "",
"flow": "xtls-rprx-direct"
}
],
"decryption": "none",
"fallbacks": [
{
"dest": 60000,
"alpn": "",
"xver": 1
},
{
"dest": 60001,
"alpn": "h2",
"xver": 1
},
{
"dest": 60002,
"path": "/9d/",
"xver": 1
},
{
"name": "",
"dest": 5003,
"xver": 1
},
{
"name": "",
"alpn": "h2",
"dest": 5004,
"xver": 1
},
{
"alpn": "http/1.1",
"dest": 800
},
{
"alpn": "h2",
"dest": 801
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
The text was updated successfully, but these errors were encountered: