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

UDS: Keep valid source addr #4325

Merged
merged 1 commit into from
Jan 26, 2025
Merged

UDS: Keep valid source addr #4325

merged 1 commit into from
Jan 26, 2025

Conversation

Fangliding
Copy link
Member

close #4324
之前因为UDS的source留空会导致panic 所以写了具体的 uds 地址作为占位符
但是UDS监听不一定代表源地址是无效的 当时没有考虑到 源地址可能被传输协议专有的方法比如从 X-Forwarded-For 中读取出来 这种情况下源地址是有效的 所以稍微做一下校验
至于issue里有的情况没法复现 因为各入站实现不同 有的是从 conn 中读取源地址 这种可以正常读到 有的是从 ctx 读取 填入uds作为占位的情况只填到了 ctx 里面

@RPRX RPRX merged commit 3a7a78f into main Jan 26, 2025
70 checks passed
@RPRX RPRX deleted the UDS branch January 27, 2025 20:47
@savimisha
Copy link

savimisha commented Feb 9, 2025

@Fangliding
This commit causes error in logs: [Error] common/net: invalid IP format: []
It happens when using fallback from one inbound to another. Second inbound should listen Unix socket.
Example configuration: https://github.com/chika0801/Xray-examples/blob/main/VLESS-XHTTP-REALITY/steal_oneself/config_server.json

@RPRX
Copy link
Member

RPRX commented Feb 12, 2025

Fangliding added a commit that referenced this pull request Feb 13, 2025
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

Successfully merging this pull request may close these issues.

反代 HTTPUpgrade 使用 UDS 连接,服务端日志无法正常显示客户端 IP。
3 participants