Skip to content
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

Proxy Protocol 某些情况下会有IP识别问题 #1690

Closed
himgoods opened this issue Feb 22, 2023 · 2 comments
Closed

Proxy Protocol 某些情况下会有IP识别问题 #1690

himgoods opened this issue Feb 22, 2023 · 2 comments

Comments

@himgoods
Copy link

RT,使用nginx stream模块转发,
转发链为:nginx A ---> nginx B ---> Xray-core

在机器有IPv6的时候Proxy Protocol的原始地址会变为IPv6兼容模式(IPv4-Mapped IPv6 Address),实际显示为: ::ffff:123.123.123.123
所有 IPv4 地址都会以 "::ffff:" 为前缀,这时把流量转发到XrayR会出现以下报错:
proxyproto: invalid address

附nginx配置

NGINX SERVER A

stream{
set_real_ip_from 0.0.0.0/0;
set_real_ip_from ::/0;
server{
listen 123;
listen [::]:123;
listen 123 udp;
listen [::]:123 udp;
proxy_protocol on;
proxy_pass 123.123.123.123:12345
}
}

NGINX SERVER B

stream{
set_real_ip_from 0.0.0.0/0;
set_real_ip_from ::/0;
server{
listen 12345 proxy_protocol;
listen [::]:12345 proxy_protocol;
listen 123 udp;
listen [::]:123 udp;
proxy_protocol on;
proxy_pass 127.0.0.1:10086 #Xray-core
}
}

@RPRX
Copy link
Member

RPRX commented Feb 22, 2023

非 Xray 的问题,接收 PROXY protocol 用的是这个库:https://github.com/pires/go-proxyproto ,麻烦发到它的 issue 区。

@RPRX RPRX closed this as completed Feb 22, 2023
@himgoods
Copy link
Author

非 Xray 的问题,接收 PROXY protocol 用的是这个库:https://github.com/pires/go-proxyproto ,麻烦发到它的 issue 区。

#1801 麻烦大佬合并一下PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants