dialer: Allow nil router

This commit is contained in:
世界
2024-04-25 22:16:13 +08:00
parent d612620c5d
commit 7d4e6a7f4e
2 changed files with 13 additions and 4 deletions

View File

@@ -13,6 +13,9 @@ func New(router adapter.Router, options option.DialerOptions) (N.Dialer, error)
if options.IsWireGuardListener {
return NewDefault(router, options)
}
if router == nil {
return NewDefault(nil, options)
}
var (
dialer N.Dialer
err error