Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/websocket

Package Overview
Dependencies
Maintainers
20
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/websocket - npm Package Compare versions

Comparing version 7.1.0 to 7.1.1

4

index.js

@@ -64,2 +64,6 @@ 'use strict'

connection.on('error', (error) => {
fastify.log.error(error)
})
connection.socket.on('newListener', event => {

@@ -66,0 +70,0 @@ if (event === 'message') {

2

package.json
{
"name": "@fastify/websocket",
"version": "7.1.0",
"version": "7.1.1",
"description": "basic websocket support for fastify",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -132,5 +132,6 @@ # @fastify/websocket

import Fastify from 'fastify'
import websocket from '@fastify/websocket'
const fastify = Fastify()
await fastify.register(require('@fastify/websocket'))
await fastify.register(websocket)

@@ -137,0 +138,0 @@ fastify.get('/', { websocket: true }, function wsHandler (connection, req) {

@@ -567,1 +567,23 @@ 'use strict'

})
test('Should Handle WebSocket errors to avoid Node.js crashes', async t => {
t.plan(1)
const fastify = Fastify()
await fastify.register(fastifyWebsocket)
fastify.get('/', { websocket: true }, ({ socket }) => {
socket.on('error', err => {
t.equal(err.code, 'WS_ERR_UNEXPECTED_RSV_2_3')
})
})
await fastify.listen({ port: 0 })
const client = new WebSocket('ws://localhost:' + fastify.server.address().port)
await once(client, 'open')
client._socket.write(Buffer.from([0xa2, 0x00]))
await fastify.close()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc