Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Localaddr#6526

Open
Fangliding wants to merge 3 commits into
mainXTLS/Xray-core:mainfrom
localaddrXTLS/Xray-core:localaddrCopy head branch name to clipboard
Open

Localaddr#6526
Fangliding wants to merge 3 commits into
mainXTLS/Xray-core:mainfrom
localaddrXTLS/Xray-core:localaddrCopy head branch name to clipboard

Conversation

@Fangliding

Copy link
Copy Markdown
Member

#6476 加了grpc的版本

echoowall and others added 3 commits July 12, 2026 03:39
The XHTTP inbound set every accepted connection's LocalAddr to the
listener's address (h.localAddr = l.listener.Addr()). On a wildcard
listener that is the unspecified address ("[::]" / "0.0.0.0").

sendThrough "origin" derives the outbound gateway from inbound.Local,
which comes from conn.LocalAddr(). So with XHTTP every connection's
egress was bound to the wildcard, collapsing all entry IPs onto one
(often IPv6) source address and breaking source-in-source-out on
multi-IP hosts (and failing outright when that address has no route).

Read the concrete per-connection local address from the request context
(http.LocalAddrContextKey), which net/http populates with the address
the client actually connected to. Fall back to the listener address when
the key is absent (e.g. HTTP/3, where net/http does not set it).
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.