4 Commits

Author SHA1 Message Date
Umbrix Developer
85db0efc59 feat: Add per-app proxy (Split Tunneling) for desktop platforms
Some checks are pending
CI / run (push) Waiting to run
- Add PerAppProxyOptions struct with Mode, IncludedApplications, ExcludedApplications
- Implement routing rules for include/exclude modes
- Include mode: selected apps use VPN, others go direct
- Exclude mode: selected apps bypass VPN, others use VPN
- Only active on non-Android platforms (Windows, Linux, macOS)
- Logging added for debugging per-app routing decisions

Part of v1.7.6 Split Tunneling feature
2026-01-20 17:38:25 +03:00
Umbrix Developer
2ed45f2485 chore: Ignore backup files 2026-01-20 16:55:29 +03:00
Umbrix Developer
0e15babcb3 fix: Exclude Umbrix processes from VPN routing
- Uncommented process exclusion rule for desktop platforms
- Changed process names from Hiddify to Umbrix
- Added 'Umbrix Start.exe' to handle renamed launcher
- Prevents routing loops when Umbrix routes its own traffic

Process names excluded:
- Umbrix, Umbrix.exe (main app)
- Umbrix Start.exe (launcher)
- UmbrixCli, UmbrixCli.exe (CLI utility)
2026-01-20 16:54:51 +03:00
Umbrix Developer
6dfe63ea76 Add Umbrix CLI icon for Windows
Some checks failed
CI / run (push) Has been cancelled
- Added umbrix-cli.ico (207KB, multi-layer icon from main app)
- Updated Makefile: use umbrix-cli.ico instead of hiddify-cli.ico
- HiddifyCli.exe now displays Umbrix icon instead of Hiddify branding
2026-01-20 07:44:13 +03:00
5 changed files with 68 additions and 12 deletions

2
.gitignore vendored
View File

@@ -9,4 +9,4 @@ cert
**/*.syso
node_modules
*.db
*.json
*.json*.backup*

View File

@@ -58,7 +58,7 @@ windows-amd64:
go install -mod=readonly github.com/akavel/rsrc@latest ||echo "rsrc error in installation"
go run ./cli tunnel exit
cp $(BINDIR)/$(LIBNAME).dll ./$(LIBNAME).dll
$$(go env GOPATH)/bin/rsrc -ico ./assets/hiddify-cli.ico -o ./cli/bydll/cli.syso ||echo "rsrc error in syso"
$$(go env GOPATH)/bin/rsrc -ico ./assets/umbrix-cli.ico -o ./cli/bydll/cli.syso ||echo "rsrc error in syso"
env GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CGO_LDFLAGS="$(LIBNAME).dll" $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME).exe ./cli/bydll
rm ./$(LIBNAME).dll
make webui

BIN
assets/umbrix-cli.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@@ -14,6 +14,7 @@ import (
"time"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
dns "github.com/sagernet/sing-dns"
)
@@ -482,17 +483,65 @@ func setRoutingOptions(options *option.Options, opt *HiddifyOptions) {
},
},
)
// routeRules = append(
// routeRules,
// option.Rule{
// Type: C.RuleTypeDefault,
// DefaultOptions: option.DefaultRule{
// ProcessName: []string{"Hiddify", "Hiddify.exe", "HiddifyCli", "HiddifyCli.exe"},
// Outbound: OutboundBypassTag,
// },
// },
// )
// Exclude Umbrix itself from VPN to avoid routing loops
routeRules = append(
routeRules,
option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{
ProcessName: []string{"Umbrix", "Umbrix.exe", "Umbrix Start.exe", "UmbrixCli", "UmbrixCli.exe"},
Outbound: OutboundBypassTag,
},
},
)
}
// Per-App Proxy for Desktop platforms (Windows, Linux, macOS)
if runtime.GOOS != "android" {
if opt.PerAppProxyOptions.Mode == "include" && len(opt.PerAppProxyOptions.IncludedApplications) > 0 {
// Mode: Only selected apps use VPN
log.Info("[Per-App] Mode: include - ", len(opt.PerAppProxyOptions.IncludedApplications), " apps will use VPN")
// Rule 1: Selected apps → VPN
routeRules = append(
routeRules,
option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{
ProcessName: opt.PerAppProxyOptions.IncludedApplications,
Outbound: OutboundSelectTag,
},
},
)
// Rule 2: All other apps → Direct
routeRules = append(
routeRules,
option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{
Outbound: OutboundDirectTag,
},
},
)
} else if opt.PerAppProxyOptions.Mode == "exclude" && len(opt.PerAppProxyOptions.ExcludedApplications) > 0 {
// Mode: Excluded apps DON'T use VPN
log.Info("[Per-App] Mode: exclude - ", len(opt.PerAppProxyOptions.ExcludedApplications), " apps will bypass VPN")
// Rule: Excluded apps → Direct (rest goes through VPN by default)
routeRules = append(
routeRules,
option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{
ProcessName: opt.PerAppProxyOptions.ExcludedApplications,
Outbound: OutboundDirectTag,
},
},
)
}
}
routeRules = append(routeRules, option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{

View File

@@ -26,6 +26,13 @@ type HiddifyOptions struct {
InboundOptions
URLTestOptions
RouteOptions
PerAppProxyOptions
}
type PerAppProxyOptions struct {
Mode string `json:"per-app-proxy-mode"` // "off", "include", "exclude"
IncludedApplications []string `json:"included-applications"` // ["chrome.exe", "firefox.exe"]
ExcludedApplications []string `json:"excluded-applications"` // ["steam.exe", "uTorrent.exe"]
}
type DNSOptions struct {