Skip to content

Commit 1667544

Browse files
committed
perform ping() operation only if state if OPEN
1 parent a144902 commit 1667544

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hapi-plugin-websocket.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ const register = async (server, pluginOptions) => {
183183
ws.terminate()
184184
else {
185185
ws.isAlive = false
186-
ws.ping("", false)
186+
if (ws.readyState === WS.OPEN)
187+
ws.ping("", false)
187188
}
188189
})
189190
}, routeOptions.autoping)

0 commit comments

Comments
 (0)