Fix network monitor

This commit is contained in:
世界
2023-07-23 14:42:19 +08:00
parent 0cbfc59b37
commit 4f847ab87d
21 changed files with 79 additions and 80 deletions

View File

@@ -241,9 +241,9 @@ func (h *Hysteria) udpRecvLoop(conn quic.Connection) {
}
}
func (h *Hysteria) InterfaceUpdated() error {
func (h *Hysteria) InterfaceUpdated() {
h.Close()
return nil
return
}
func (h *Hysteria) Close() error {

View File

@@ -129,11 +129,11 @@ func (h *Shadowsocks) NewPacketConnection(ctx context.Context, conn N.PacketConn
return NewPacketConnection(ctx, h, conn, metadata)
}
func (h *Shadowsocks) InterfaceUpdated() error {
func (h *Shadowsocks) InterfaceUpdated() {
if h.multiplexDialer != nil {
h.multiplexDialer.Reset()
}
return nil
return
}
func (h *Shadowsocks) Close() error {

View File

@@ -174,9 +174,9 @@ func (s *SSH) connect() (*ssh.Client, error) {
return client, nil
}
func (s *SSH) InterfaceUpdated() error {
func (s *SSH) InterfaceUpdated() {
common.Close(s.clientConn)
return nil
return
}
func (s *SSH) Close() error {

View File

@@ -104,11 +104,11 @@ func (h *Trojan) NewPacketConnection(ctx context.Context, conn N.PacketConn, met
return NewPacketConnection(ctx, h, conn, metadata)
}
func (h *Trojan) InterfaceUpdated() error {
func (h *Trojan) InterfaceUpdated() {
if h.multiplexDialer != nil {
h.multiplexDialer.Reset()
}
return nil
return
}
func (h *Trojan) Close() error {

View File

@@ -138,9 +138,9 @@ func (s *URLTest) NewPacketConnection(ctx context.Context, conn N.PacketConn, me
return NewPacketConnection(ctx, s, conn, metadata)
}
func (s *URLTest) InterfaceUpdated() error {
func (s *URLTest) InterfaceUpdated() {
go s.group.CheckOutbounds(true)
return nil
return
}
type URLTestGroup struct {

View File

@@ -123,11 +123,11 @@ func (h *VLESS) NewPacketConnection(ctx context.Context, conn N.PacketConn, meta
return NewPacketConnection(ctx, h, conn, metadata)
}
func (h *VLESS) InterfaceUpdated() error {
func (h *VLESS) InterfaceUpdated() {
if h.multiplexDialer != nil {
h.multiplexDialer.Reset()
}
return nil
return
}
func (h *VLESS) Close() error {

View File

@@ -98,11 +98,11 @@ func NewVMess(ctx context.Context, router adapter.Router, logger log.ContextLogg
return outbound, nil
}
func (h *VMess) InterfaceUpdated() error {
func (h *VMess) InterfaceUpdated() {
if h.multiplexDialer != nil {
h.multiplexDialer.Reset()
}
return nil
return
}
func (h *VMess) Close() error {

View File

@@ -186,9 +186,9 @@ func NewWireGuard(ctx context.Context, router adapter.Router, logger log.Context
return outbound, nil
}
func (w *WireGuard) InterfaceUpdated() error {
func (w *WireGuard) InterfaceUpdated() {
w.bind.Reset()
return nil
return
}
func (w *WireGuard) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error) {