Compare commits

...
5 Commits
Author SHA1 Message Date
Fangliding 212d1b108b handle localhost 2026-06-05 21:08:34 +08:00
Fangliding 2101c1a99f use netip 2026-06-05 18:36:53 +08:00
Fangliding e1fe8be7a5 typo 2026-06-05 18:30:38 +08:00
Fangliding bbc8103a7d Bypass default interface for loopback 2026-06-05 17:16:53 +08:00
fdb9b616fc README.md: Add Hey to HarmonyOS in GUI Clients (#6244)
https://github.com/popsiclelmlm/Hey/blob/main/entry/src/main/cpp/README.md

---------

Co-authored-by: liumin01 <liumin01@roborock.com>
2026-06-02 23:58:56 +00:00
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -145,6 +145,8 @@
- [v2rayN](https://github.com/2dust/v2rayN)
- [GenyConnect](https://github.com/genyleap/GenyConnect)
- [OneXray](https://github.com/OneXray/OneXray)
- HarmonyOS
- [Hey](https://github.com/popsiclelmlm/Hey)
## Others that support VLESS, XTLS, REALITY, XUDP, PLUX...
+7
View File
@@ -2,6 +2,8 @@ package tun
import (
"context"
"net/netip"
"strings"
"syscall"
"github.com/xtls/xray-core/common"
@@ -80,6 +82,11 @@ func (t *Handler) Init(ctx context.Context, pm policy.Manager, dispatcher routin
return nil
}
return c.Control(func(fd uintptr) {
addrPort, _ := netip.ParseAddrPort(address)
// skip loopback
if addrPort.Addr().IsLoopback() || strings.HasPrefix(strings.ToLower(address), "localhost:") {
return
}
err := setinterface(network, address, fd, iface)
if err != nil {
errors.LogInfoInner(context.Background(), err, "[tun] falied to set interface")