如果 websocket 握手超时设置为 0 会发生什么
Whats happend if websocket handshake timeout set 0
我想深入了解 websocket 中的握手超时。在此之前,我从我的 websocket 中收到此错误,我将 HandshakeTimeout
设置为 10 seconds
。
websocket: close 1006 (abnormal closure): unexpected EOF
我正在尝试寻找如何解决这个错误,很多组都说要增加HandshakeTimeout
。
但是,我的想法不同,我想像这样设置配置 websocket:
ws := websocket.Upgrader{
ReadBufferSize: 0,
WriteBufferSize: 0,
HandshakeTimeout: 0,
CheckOrigin: func(r *nethttp.Request) bool {
return true
},
}
我的问题是。如果我将 HandshakeTimeout
设置为 0
是否会出现任何漏洞问题或负面问题?
我正在使用 gorilla 在我的代码中设置 websocket。
值为零时没有超时。如果没有超时,与连接相关的资源(包括 goroutine)可以保持任意时间。
我想深入了解 websocket 中的握手超时。在此之前,我从我的 websocket 中收到此错误,我将 HandshakeTimeout
设置为 10 seconds
。
websocket: close 1006 (abnormal closure): unexpected EOF
我正在尝试寻找如何解决这个错误,很多组都说要增加HandshakeTimeout
。
但是,我的想法不同,我想像这样设置配置 websocket:
ws := websocket.Upgrader{
ReadBufferSize: 0,
WriteBufferSize: 0,
HandshakeTimeout: 0,
CheckOrigin: func(r *nethttp.Request) bool {
return true
},
}
我的问题是。如果我将 HandshakeTimeout
设置为 0
是否会出现任何漏洞问题或负面问题?
我正在使用 gorilla 在我的代码中设置 websocket。
值为零时没有超时。如果没有超时,与连接相关的资源(包括 goroutine)可以保持任意时间。