mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-05 05:27:31 +00:00
chore: dialer will consider the routing of the local interface when auto-detect-interface in tun is enabled
for #1881 #1819
This commit is contained in:
@@ -3,6 +3,7 @@ package dialer
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/netip"
|
||||
|
||||
"github.com/metacubex/mihomo/common/atomic"
|
||||
"github.com/metacubex/mihomo/component/resolver"
|
||||
@@ -12,8 +13,14 @@ var (
|
||||
DefaultOptions []Option
|
||||
DefaultInterface = atomic.NewTypedValue[string]("")
|
||||
DefaultRoutingMark = atomic.NewInt32(0)
|
||||
|
||||
DefaultInterfaceFinder = atomic.NewTypedValue[InterfaceFinder](nil)
|
||||
)
|
||||
|
||||
type InterfaceFinder interface {
|
||||
FindInterfaceName(destination netip.Addr) string
|
||||
}
|
||||
|
||||
type NetDialer interface {
|
||||
DialContext(ctx context.Context, network, address string) (net.Conn, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user