mirror of
https://github.com/niusmallnan/steve.git
synced 2025-06-27 23:16:56 +00:00
Make handshake timeout consistent with rancher agent
This commit is contained in:
parent
c6547ae887
commit
43139e348a
@ -15,10 +15,14 @@ import (
|
|||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HandshakeTimeOut = 10 * time.Second
|
||||||
|
)
|
||||||
|
|
||||||
func ListenAndServe(ctx context.Context, url string, caCert []byte, token string, handler http.Handler) {
|
func ListenAndServe(ctx context.Context, url string, caCert []byte, token string, handler http.Handler) {
|
||||||
dialer := websocket.Dialer{
|
dialer := websocket.Dialer{
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
HandshakeTimeout: 45 * time.Second,
|
HandshakeTimeout: HandshakeTimeOut,
|
||||||
}
|
}
|
||||||
|
|
||||||
if caCert != nil && len(caCert) == 0 {
|
if caCert != nil && len(caCert) == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user