patternihaandClaude Opus 5.5 ab3c3f9909 TUN inbound: Consolidate files and remove unneeded tests; Rename wfp_leak.go to wfp_block.go
As requested in https://github.com/XTLS/Xray-core/pull/7460#issuecomment-7131171930:
proxy/tun goes from 36 files to 29. No behaviour change: the merged code is
moved as it is.

Merged:
- guid.go into config.go
- tun_windows_outbound.go into tun_windows.go
- tun_windows_wfp_test.go and guid_windows_test.go into tun_windows_test.go
- tun_freebsd_dns_test.go into tun_freebsd_test.go
- tun_linux_dns_test.go and tun_linux_dns_route_test.go into tun_linux_test.go

Renamed wfp_leak.go and wfp_leak_test.go to wfp_block.go and wfp_block_test.go.

Removed:
- guid_test.go: TestTunConfigGUID in infra/conf covers what ParseGUID accepts,
  and TestAdapterGUID the bytes it returns. The one case they lacked, a hyphen
  out of place, is now in TestTunConfigGUID.
- TestLeakCovers: covers is only ever asked about port 53, which
  TestExpandWfpBlockLeak checks through BlocksSystemDNS.
- udp_queue_bench_test.go and BenchmarkUDPNewSession: benchmarks, which CI
  does not run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:25:44 +09:00
2025-08-19 13:58:06 +00:00
2020-11-25 19:01:53 +08:00

Project X

Project X originates from XTLS protocol, providing a set of network tools such as Xray-core and REALITY.

Sponsors

Remnawave

Happ

BlancVPN

Sponsor Xray-core

Donation & NFTs

Collect a Project X NFT to support the development of Project X!

Project X NFT

License

Mozilla Public License Version 2.0

Documentation

Project X Official Website

Telegram

Project X Channel

Project X (中文 / English)

Project VLESS (Русский)

Project XHTTP (Persian)

Installation

Usage

GUI Clients

Project listing criteria

To submit a project to the README, open a pull request. Projects are listed under these rules:

  • Only submit projects that build their core experience on Xray-core and follow Xray's protocol choices and security requirements; merely offering it as an interchangeable core does not qualify.
  • Projects must have been maintained for at least one month and have at least 30 stars.
  • Projects with no activity for three months will be removed.
  • Closed-source iOS clients must be submitted by their developers.

Others that support VLESS, XTLS, REALITY, XUDP, PLUX...

Contributing

For code contributions, please read CONTRIBUTING.md and Code of Conduct before opening a pull request.

Ask DeepWiki might be helpful.

Credits

Bundled Third-Party Components Redistribution

Certain optional features dynamically load third-party components. These optional components are separate works distributed under their own licenses, and are bundled into the ZIP package for ease of use. Users may replace these components under the licenses from these components.

These components include:

Wintun

This distribution contains unmodified official precompiled and pre-signed Wintun binaries.

  • Project: Wintun
  • Copyright: Copyright (C) 2018-2021 WireGuard LLC. All Rights Reserved.
  • Redistribution License: Prebuilt Binaries License (PBL) bundled with official precompiled and pre-signed binaries from wintun.net
  • Component(s): wintun.dll
  • Source: https://www.wintun.net/
  • Included in:
    • Windows x86 (windows-32, win7-32)
    • Windows x86-64 (windows-64, win7-64)
    • Windows AArch64 (windows-arm64)
  • Notes: Wintun is an optional runtime-loaded component only used for TUN inbound functionality on supported Windows platforms.

One-line Compilation

Windows (PowerShell)

$env:CGO_ENABLED=0
go build -o xray.exe -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -v ./main

Linux / macOS

CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -v ./main

Reproducible Releases

Make sure that you are using the same Go version, and remember to set the git commit id (7 bytes):

CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main

For Windows (x86-64 and AArch64, not win7):

GOOS=windows GOARCH=amd64 GOAMD64=v2 CGO_ENABLED=0 go build -o xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main
GOOS=windows GOARCH=arm64 GOARM64=v8.2 CGO_ENABLED=0 go build -o xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main

For macOS:

GOOS=darwin GOARCH=amd64 GOAMD64=v2 CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main
GOOS=darwin GOARCH=arm64 GOARM64=v8.4 CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main

For Android:

GOOS=android GOARCH=arm64 CGO_ENABLED=1 CC=/path/to/aarch64-linux-android24-clang go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid= -checklinkname=0 -extldflags=-Wl,--pack-dyn-relocs=android" -v ./main
GOOS=android GOARCH=amd64 CGO_ENABLED=1 CC=/path/to/x86_64-linux-android24-clang go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid= -checklinkname=0 -extldflags=-Wl,--pack-dyn-relocs=android" -v ./main

For Linux (MIPS32 and MIPS32LE):

GOOS=linux GOARCH=mips GOMIPS=hardfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main
GOOS=linux GOARCH=mips GOMIPS=softfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main
GOOS=linux GOARCH=mipsle GOMIPS=hardfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main
GOOS=linux GOARCH=mipsle GOMIPS=softfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main

Stargazers over time

Star History Chart
Languages
Go 99.8%
HTML 0.1%