Feature: dial different NIC for all proxies (#1714)

This commit is contained in:
Dreamacro
2021-11-07 16:48:51 +08:00
committed by GitHub
parent bcb301b730
commit 1a7830f18e
21 changed files with 206 additions and 139 deletions

View File

@ -5,6 +5,8 @@ import (
"fmt"
"net"
"time"
"github.com/Dreamacro/clash/component/dialer"
)
// Adapter Type
@ -90,9 +92,9 @@ type ProxyAdapter interface {
// DialContext return a C.Conn with protocol which
// contains multiplexing-related reuse logic (if any)
DialContext(ctx context.Context, metadata *Metadata) (Conn, error)
DialContext(ctx context.Context, metadata *Metadata, opts ...dialer.Option) (Conn, error)
ListenPacketContext(ctx context.Context, metadata *Metadata) (PacketConn, error)
ListenPacketContext(ctx context.Context, metadata *Metadata, opts ...dialer.Option) (PacketConn, error)
// Unwrap extracts the proxy from a proxy-group. It returns nil when nothing to extract.
Unwrap(metadata *Metadata) Proxy