You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/proxy/proxy.go
+39-6Lines changed: 39 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ import (
4
4
"bytes"
5
5
"io/ioutil"
6
6
stdlog "log"
7
+
"net"
7
8
"net/http"
8
9
"net/http/httputil"
9
10
"net/url"
@@ -17,12 +18,26 @@ import (
17
18
)
18
19
19
20
const (
20
-
// DefaultBufferCount TODO
21
+
// DefaultBufferCount is the default value for the maximum size of the buffer pool for the reverse proxy.
21
22
DefaultBufferCount=2*1024
22
-
// DefaultBufferSizeBytes TODO
23
+
// DefaultBufferSizeBytes is the default value for the length of the buffers in the buffer pool for the reverse proxy.
23
24
DefaultBufferSizeBytes=32*1024
24
-
// DefaultFlushInterval TODO
25
+
// DefaultFlushInterval is the default value for the flush interval of reverse proxy to flush to the client while copying the response body.
25
26
DefaultFlushInterval=time.Duration(-1)
27
+
28
+
// defaultTimeout is the default value for the maximum amount of time a dial will wait for a connect to complete.
29
+
defaultTimeout=30*time.Second
30
+
// defaultKeepAlive is the default value for the interval between keep-alive probes for an active network connection.
31
+
defaultKeepAlive=30*time.Second
32
+
// defaultMaxIdleConns is the default value for the maximum idle (keep-alive) connections to keep per-host.
33
+
defaultMaxIdleConns=100
34
+
// defaultIdleConnTimeout is the default value for the maximum amount of time an idle (keep-alive) connection will remain idle before closing itself.
35
+
defaultIdleConnTimeout=90*time.Second
36
+
// defaultTLSHandshakeTimeout is the default value for the maximum amount of time waiting to wait for a TLS handshake.
37
+
defaultTLSHandshakeTimeout=10*time.Second
38
+
// defaultExpectContinueTimeout is the default value for the amount of time to wait for a server's first response headers after fully writing the request headers,
39
+
// if the request has an "Expect: 100-continue" header.
0 commit comments