mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
fix: inner request error
This commit is contained in:
parent
573be855f7
commit
c161d5e6be
|
@ -33,15 +33,10 @@ func NewInner(conn net.Conn, dst string, host string) *context.ConnContext {
|
|||
metadata.Host = host
|
||||
metadata.AddrType = C.AtypDomainName
|
||||
metadata.Process = C.ClashName
|
||||
if ip, port, err := parseAddr(dst); err == nil {
|
||||
if h, port, err := net.SplitHostPort(dst); err == nil {
|
||||
metadata.DstPort = port
|
||||
if host == "" {
|
||||
metadata.DstIP = ip
|
||||
if ip.Is4() {
|
||||
metadata.AddrType = C.AtypIPv6
|
||||
} else {
|
||||
metadata.AddrType = C.AtypIPv4
|
||||
}
|
||||
metadata.Host = h
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package provider
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Dreamacro/clash/component/dialer"
|
||||
"github.com/Dreamacro/clash/listener/inner"
|
||||
"io"
|
||||
"net"
|
||||
|
@ -86,10 +85,6 @@ func (h *HTTPVehicle) Read() ([]byte, error) {
|
|||
client := http.Client{Transport: transport}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
transport.DialContext = func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return dialer.DialContext(ctx, network, address)
|
||||
}
|
||||
resp, err = client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user