mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-10 11:03:13 +00:00
22 lines
536 B
Go
22 lines
536 B
Go
package mux
|
|
|
|
import (
|
|
"github.com/sagernet/sing-box/option"
|
|
"github.com/sagernet/sing-mux"
|
|
N "github.com/sagernet/sing/common/network"
|
|
)
|
|
|
|
func NewClientWithOptions(dialer N.Dialer, options option.MultiplexOptions) (*Client, error) {
|
|
if !options.Enabled {
|
|
return nil, nil
|
|
}
|
|
return mux.NewClient(mux.Options{
|
|
Dialer: dialer,
|
|
Protocol: options.Protocol,
|
|
MaxConnections: options.MaxConnections,
|
|
MinStreams: options.MinStreams,
|
|
MaxStreams: options.MaxStreams,
|
|
Padding: options.Padding,
|
|
})
|
|
}
|