1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00
This commit is contained in:
Kane York 2017-10-27 13:15:00 -07:00
parent 85a0fb7b79
commit ea4909cdc6
2 changed files with 5 additions and 7 deletions

View file

@ -463,7 +463,7 @@ func runSocketReader(conn *websocket.Conn, client *ClientInfo, errorChan chan<-
}
func runSocketWriter(conn *websocket.Conn, client *ClientInfo, errorChan <-chan error, clientChan <-chan ClientMessage, serverMessageChan <-chan ClientMessage) websocket.CloseError {
pingTicker := time.NewTicker(1*time.Minute)
pingTicker := time.NewTicker(1 * time.Minute)
defer pingTicker.Stop()
lastPacket := time.Now()
@ -512,9 +512,9 @@ func runSocketWriter(conn *websocket.Conn, client *ClientInfo, errorChan <-chan
case <-pingTicker.C:
now := time.Now()
if lastPacket.Add(5*time.Minute).Before(now) {
if lastPacket.Add(5 * time.Minute).Before(now) {
return CloseTimedOut
} else if lastPacket.Add(1*time.Minute).Before(now) {
} else if lastPacket.Add(1 * time.Minute).Before(now) {
conn.WriteControl(websocket.PingMessage, []byte(strconv.FormatInt(time.Now().Unix(), 10)), getDeadline())
}

View file

@ -47,13 +47,11 @@ type ConfigFile struct {
ProxyRoutes []ProxyRoute
}
type ProxyRoute struct {
Route string
Server string
Route string
Server string
}
type ClientMessage struct {
// Message ID. Increments by 1 for each message sent from the client.
// When replying to a command, the message ID must be echoed.