urltest: Recheck after network change

This commit is contained in:
世界 2023-04-13 16:11:46 +08:00
parent 221cce6e57
commit 7f49c45673
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -20,8 +20,9 @@ import (
) )
var ( var (
_ adapter.Outbound = (*URLTest)(nil) _ adapter.Outbound = (*URLTest)(nil)
_ adapter.OutboundGroup = (*URLTest)(nil) _ adapter.OutboundGroup = (*URLTest)(nil)
_ adapter.InterfaceUpdateListener = (*URLTest)(nil)
) )
type URLTest struct { type URLTest struct {
@ -122,6 +123,11 @@ func (s *URLTest) NewPacketConnection(ctx context.Context, conn N.PacketConn, me
return NewPacketConnection(ctx, s, conn, metadata) return NewPacketConnection(ctx, s, conn, metadata)
} }
func (s *URLTest) InterfaceUpdated() error {
go s.group.checkOutbounds()
return nil
}
type URLTestGroup struct { type URLTestGroup struct {
ctx context.Context ctx context.Context
router adapter.Router router adapter.Router