Avoid nested direct outbound usage

This commit is contained in:
世界
2023-12-20 19:15:59 +08:00
parent 081c45b9d7
commit 6fe582fcd7
4 changed files with 27 additions and 11 deletions

View File

@@ -35,6 +35,9 @@ type Direct struct {
func NewDirect(router adapter.Router, logger log.ContextLogger, tag string, options option.DirectOutboundOptions) (*Direct, error) {
options.UDPFragmentDefault = true
if options.Detour != "" {
return nil, E.New("detour option for direct outbound is illegal")
}
outboundDialer, err := dialer.New(router, options.DialerOptions)
if err != nil {
return nil, err