mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-09 07:40:11 +00:00
Improve network reset
This commit is contained in:
@@ -28,7 +28,10 @@ func RegisterURLTest(registry *outbound.Registry) {
|
||||
outbound.Register[option.URLTestOutboundOptions](registry, C.TypeURLTest, NewURLTest)
|
||||
}
|
||||
|
||||
var _ adapter.OutboundGroup = (*URLTest)(nil)
|
||||
var (
|
||||
_ adapter.OutboundGroup = (*URLTest)(nil)
|
||||
_ adapter.InterfaceUpdateListener = (*URLTest)(nil)
|
||||
)
|
||||
|
||||
type URLTest struct {
|
||||
outbound.Adapter
|
||||
@@ -118,6 +121,17 @@ func (s *URLTest) PerformUpdateCheck() {
|
||||
s.group.performUpdateCheck()
|
||||
}
|
||||
|
||||
func (s *URLTest) InterfaceUpdated() {
|
||||
group := s.group
|
||||
if group == nil {
|
||||
return
|
||||
}
|
||||
if group.pause.IsDevicePaused() || group.pause.IsNetworkPaused() {
|
||||
return
|
||||
}
|
||||
go group.CheckOutbounds(true)
|
||||
}
|
||||
|
||||
func (s *URLTest) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error) {
|
||||
s.group.Touch()
|
||||
var outbound adapter.Outbound
|
||||
|
||||
Reference in New Issue
Block a user