chore: adding some docs

This commit is contained in:
WendelHime 2025-03-04 17:23:35 -03:00
parent 654ae54f9e
commit 682408ae30
No known key found for this signature in database
GPG Key ID: CA80EF380D5B4207

View File

@ -69,19 +69,21 @@ func NewOutbound(ctx context.Context, router adapter.Router, log log.ContextLogg
return nil, err
}
outbound := &Outbound{
Adapter: outbound.NewAdapterWithDialerOptions("outline", tag, []string{network.NetworkTCP}, options.DialerOptions),
Adapter: outbound.NewAdapterWithDialerOptions(C.TypeOutline, tag, []string{network.NetworkTCP}, options.DialerOptions),
logger: log,
dialerMutex: &sync.Mutex{},
}
createDialer := sync.OnceValues(func() (transport.StreamDialer, error) {
// During the dialer creation the strategy finder try to use the stream dialer
// for resolving the domains. We can't create the smart dialer during the
// outbound initialization because there wouldn't be a tunnel to communicate.
// So for fixing this issue, the dialer must be created during the DialContext call.
createDialer: sync.OnceValues(func() (transport.StreamDialer, error) {
dialer, err := strategyFinder.NewDialer(ctx, options.Domains, yamlOptions)
if err != nil {
return nil, err
}
return dialer, nil
})
outbound.createDialer = createDialer
}),
}
return outbound, nil
}