diff --git a/source/vibe/http/websockets.d b/source/vibe/http/websockets.d index 23b893839c..1d16e314e5 100644 --- a/source/vibe/http/websockets.d +++ b/source/vibe/http/websockets.d @@ -208,8 +208,10 @@ final class WebSocket { m_writeMutex = new TaskMutex; m_readMutex = new TaskMutex; m_readCondition = new TaskCondition(m_readMutex); - m_pingTimer = setTimer(dur!"seconds"(60), &sendPing, true); - m_pongReceived = true; + if (request !is null && request.serverSettings.webSocketPingInterval != Duration.zero) { + m_pingTimer = setTimer(request.serverSettings.webSocketPingInterval, &sendPing, true); + m_pongReceived = true; + } } /**