security/xproxy: add new plugin#5357
Draft
dasunNimantha wants to merge 1 commit intoopnsense:masterfrom
Draft
Conversation
Member
|
We do have a template for PRs, please do not delete it. If you are using AI please tell your agent to not delete it. There are no downsides here, it just helps with triage. |
Author
oops, I've updated the PR description to include all the required fields. Thanks for the heads up. |
c4c5834 to
0bebdf9
Compare
Xray-core proxy client with transparent LAN routing via hev-socks5-tunnel TUN interface. Supports VLESS (with XTLS-Vision / Reality), VMess, Shadowsocks, and Trojan protocols with URI import and policy-based routing. Closes opnsense#5347
0bebdf9 to
b3dd9cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:
If AI was used, please disclose:
Related issue
#5347
Describe the problem
There is currently no OPNsense plugin for Xray-core integration. Users who want to route LAN traffic through a VLESS, VMess, Shadowsocks, or Trojan tunnel must manually configure xray from the command line, create TUN interfaces, set up gateways, and write firewall rules.
Describe the proposed solution
New plugin: security/xproxy — Xray-core proxy client with transparent LAN routing.
When enabled, all LAN traffic is routed through a proxy tunnel without requiring any configuration on individual devices — phones, IoT, smart TVs, and guest devices are covered automatically.
Architecture
Features
vless://,vmess://,ss://,trojan://)Hardening
GOGC=100,GOMEMLIMIT=512MiB)routeOnly, connection policy tuning, DNS caching, TCP Fast Opensysctl.d/xproxy.confsetup.shwith retry logic, version tracking, binary validation, and atomic downloadsTesting
Tested on OPNsense 25.x (FreeBSD 14, amd64) with VLESS+XTLS-Vision+Reality tunnels to Oracle Cloud and Digital Ocean. Sustained 300+ Mbps download, 100+ Mbps upload. Memory stable after extended operation (xray ~43 MB RSS, hev-socks5-tunnel ~6 MB RSS).