use dynamic idle timeout
This commit is contained in:
@@ -450,10 +450,11 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
|
||||
Type: C.TypeURLTest,
|
||||
Tag: OutboundURLTestTag,
|
||||
URLTestOptions: option.URLTestOutboundOptions{
|
||||
Outbounds: tags,
|
||||
URL: opt.ConnectionTestUrl,
|
||||
Interval: option.Duration(opt.URLTestInterval.Duration()),
|
||||
IdleTimeout: option.Duration(opt.URLTestIdleTimeout.Duration()),
|
||||
Outbounds: tags,
|
||||
URL: opt.ConnectionTestUrl,
|
||||
Interval: option.Duration(opt.URLTestInterval.Duration()),
|
||||
// IdleTimeout: option.Duration(opt.URLTestIdleTimeout.Duration()),
|
||||
IdleTimeout: option.Duration(opt.URLTestInterval.Duration().Nanoseconds() * 10),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ type InboundOptions struct {
|
||||
}
|
||||
|
||||
type URLTestOptions struct {
|
||||
ConnectionTestUrl string `json:"connection-test-url"`
|
||||
URLTestInterval DurationInSeconds `json:"url-test-interval"`
|
||||
URLTestIdleTimeout DurationInSeconds `json:"url-test-idle-timeout"`
|
||||
ConnectionTestUrl string `json:"connection-test-url"`
|
||||
URLTestInterval DurationInSeconds `json:"url-test-interval"`
|
||||
// URLTestIdleTimeout DurationInSeconds `json:"url-test-idle-timeout"`
|
||||
}
|
||||
|
||||
type RouteOptions struct {
|
||||
@@ -108,9 +108,9 @@ func DefaultConfigOptions() *ConfigOptions {
|
||||
TUNStack: "mixed",
|
||||
},
|
||||
URLTestOptions: URLTestOptions{
|
||||
ConnectionTestUrl: "http://cp.cloudflare.com/",
|
||||
URLTestInterval: DurationInSeconds(600),
|
||||
URLTestIdleTimeout: DurationInSeconds(6000),
|
||||
ConnectionTestUrl: "http://cp.cloudflare.com/",
|
||||
URLTestInterval: DurationInSeconds(600),
|
||||
// URLTestIdleTimeout: DurationInSeconds(6000),
|
||||
},
|
||||
RouteOptions: RouteOptions{
|
||||
ResolveDestination: false,
|
||||
|
||||
Reference in New Issue
Block a user