Skip to content

feat(xhttp): complete outbound support and add inbound-side runtime tests#2656

Open
olicesx wants to merge 5 commits into
MetaCubeX:Alphafrom
olicesx:kix/xhttp-outbound
Open

feat(xhttp): complete outbound support and add inbound-side runtime tests#2656
olicesx wants to merge 5 commits into
MetaCubeX:Alphafrom
olicesx:kix/xhttp-outbound

Conversation

@olicesx

@olicesx olicesx commented Mar 30, 2026

Copy link
Copy Markdown

What

  • complete xhttp / splithttp outbound support for VLESS, VMess and Trojan
  • add inbound-side runtime tests for xhttp / splithttp combinations
  • document xhttp usage and configuration examples in docs/config.yaml

Details

  • add a shared outbound xhttp helper to keep stream dialing and transport setup consistent across protocols
  • use xhttp-opts for network: xhttp and splithttp-opts for network: splithttp, while keeping backward-compatible fallback when only one opts block is provided
  • align download-settings with mihomo style by reusing top-level tls and reality-opts instead of introducing a separate security field
  • enforce supported inbound xhttp modes and cover download-settings, try-quic, and h3-related branches
  • avoid re-wrapping TLS/default transports after xhttp dialing

Testing

  • /usr/local/go/bin/go build ./...
  • /usr/local/go/bin/go test ./...
  • PATH=/usr/local/go/bin:$PATH /root/go/bin/golangci-lint run --new-from-rev=2d34ecffe8ea262ffcdf7a15f258980cf5c1c3ac ./...

Notes

  • runtime coverage is provided by inbound-side tests for VLESS / VMess / Trojan across xhttp and splithttp combinations
  • full-repo golangci-lint run ./... still reports unrelated pre-existing baseline issues, but this PR introduces no new lint findings

kix and others added 5 commits March 31, 2026 02:58
# Conflicts:
#	adapter/outbound/vless.go
#	transport/xhttp/client.go
# Conflicts:
#	adapter/outbound/vless.go
#	listener/inbound/vless_test.go
#	listener/sing_vless/server.go
#	transport/xhttp/client.go
#	transport/xhttp/config.go
#	transport/xhttp/server.go
@daiaji

daiaji commented Apr 21, 2026

Copy link
Copy Markdown

Thanks for the refactoring. I noticed that you've already handled the !TLSEnabled case in xhttpTLSOptions.wrapConn for outbounds.

Regarding the inbound side, would it be possible to also remove the mandatory TLS requirement for Trojan/Vless? As discussed in #2640, many users want to use Nginx/Caddy for TLS termination and forward plain traffic (h2c/h1) to Mihomo. Since you are already enhancing the xhttp transport layer, supporting "Plaintext Inbound" would be a huge improvement for server-side deployments.

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.

3 participants