mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 13:41:23 +08:00
Fix: use domain first on direct dial (#672)
This commit is contained in:
parent
94e0e4b000
commit
b085addbb0
@ -14,10 +14,7 @@ type Direct struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Direct) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error) {
|
func (d *Direct) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error) {
|
||||||
address := net.JoinHostPort(metadata.Host, metadata.DstPort)
|
address := net.JoinHostPort(metadata.String(), metadata.DstPort)
|
||||||
if metadata.DstIP != nil {
|
|
||||||
address = net.JoinHostPort(metadata.DstIP.String(), metadata.DstPort)
|
|
||||||
}
|
|
||||||
|
|
||||||
c, err := dialer.DialContext(ctx, "tcp", address)
|
c, err := dialer.DialContext(ctx, "tcp", address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user