-
-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
🐛 Bug Report
After client sends ~100 messages of ~160 bytes each to websocket, connection.socket.on('message') is no longer being triggered.
It seems to be size-dependent, I can send thousands of very short (a few bytes) messages, but only around 100 lines of 160 bytes.
To Reproduce
In new dir:
yarn init
yarn add fastify fastify-websocket
Create server.js:
'use strict'
const fastify = require('fastify')()
fastify.register(require('fastify-websocket'))
fastify.get('/', { websocket: true }, (connection, req) => {
connection.socket.on('message', message => {
// message === 'hi from client'
connection.socket.send('hi from server')
})
})
fastify.listen(5000, err => {
if (err) {
fastify.log.error(err)
process.exit(1)
}
Run node server.js
In another window, run:
wscat --show-ping-pong -c "ws://localhost:5000"
Create a file with ~150 lines of 160 bytes each. Copy-paste contents into wscat.
The server will stop responding.
Expected behavior
Should keep returning responses.
Your Environment
- node version: 12
- fastify version: >=2.0.0
- os: Mac, Linux
Metadata
Metadata
Assignees
Labels
No labels