File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ func (p *ReverseProxy) init() error {
8484 IsTLS : p .opt .tlsConfig != nil ,
8585 TLSConfig : p .opt .tlsConfig ,
8686 DisablePathNormalizing : p .opt .disablePathNormalizing ,
87+ MaxConnDuration : p .opt .maxConnDuration ,
8788 }
8889 p .clients = append (p .clients , client )
8990 return nil
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ type buildOption struct {
3636
3737 // disablePathNormalizing disable path normalizing.
3838 disablePathNormalizing bool
39+
40+ // maxConnDuration of hostClient
41+ maxConnDuration time.Duration
3942}
4043
4144func defaultBuildOption () * buildOption {
@@ -119,3 +122,10 @@ func WithDisablePathNormalizing(isDisablePathNormalizing bool) Option {
119122 o .disablePathNormalizing = isDisablePathNormalizing
120123 })
121124}
125+
126+ // WithTimeout specify the timeout of each request
127+ func WithMaxConnDuration (d time.Duration ) Option {
128+ return newFuncBuildOption (func (o * buildOption ) {
129+ o .maxConnDuration = d
130+ })
131+ }
You can’t perform that action at this time.
0 commit comments