From 7f49c45673628457a8db9a0892323ab10e69b63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 13 Apr 2023 16:11:46 +0800 Subject: [PATCH] urltest: Recheck after network change --- outbound/urltest.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/outbound/urltest.go b/outbound/urltest.go index 02254df3..f5ae0726 100644 --- a/outbound/urltest.go +++ b/outbound/urltest.go @@ -20,8 +20,9 @@ import ( ) var ( - _ adapter.Outbound = (*URLTest)(nil) - _ adapter.OutboundGroup = (*URLTest)(nil) + _ adapter.Outbound = (*URLTest)(nil) + _ adapter.OutboundGroup = (*URLTest)(nil) + _ adapter.InterfaceUpdateListener = (*URLTest)(nil) ) type URLTest struct { @@ -122,6 +123,11 @@ func (s *URLTest) NewPacketConnection(ctx context.Context, conn N.PacketConn, me return NewPacketConnection(ctx, s, conn, metadata) } +func (s *URLTest) InterfaceUpdated() error { + go s.group.checkOutbounds() + return nil +} + type URLTestGroup struct { ctx context.Context router adapter.Router