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

websocket-framed

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-framed - npm Package Compare versions

Comparing version 0.9.4 to 0.9.5

3

lib/websocket-framed.node.js

@@ -103,3 +103,3 @@ "use strict";

frame.import(ev.data);
ev.data = frame;
ev.frame = frame;
this.emit("message", event);

@@ -113,2 +113,3 @@ });

this.ws.send(data);
return { frame, data };
}

@@ -115,0 +116,0 @@ }

{
"name": "websocket-framed",
"version": "0.9.4",
"version": "0.9.5",
"description": "Framed WebSocket Communication",

@@ -5,0 +5,0 @@ "keywords": [ "websocket", "frame", "message" ],

@@ -41,3 +41,3 @@

wsf.on("message", (event) => {
let request = event.data
let request = event.frame
let { fid, rid, type, message }) = request

@@ -59,8 +59,8 @@ let response = { type: ..., message: ... }

- `API::on(name: string, callback: (event: { data: { fid: number, rid: number, type: string, data: string } }) => Void): Void`
Receive a message in case `name` is `message` in the form of a decoded frame attached to `event.data`.
- `API::on(name: string, callback: (event: { frame: { fid: number, rid: number, type: string, data: string }, data: any }) => Void): Void`
Receive a message in case `name` is `message` in the form of a decoded frame attached to `event.frame`.
- `API::send(frame: { type: string, data: string }, replyTo?: frame): Void`
- `API::send(frame: { type: string, data: string }, replyTo?: frame): { frame: { fid: number, rid: number, type: string, data: string }, data: any }`
Send a message in the form of a encoded frame.
Optionally set the `rid` of the message to the `fid` of the frame you want to replyt to.
Optionally set the `rid` of the message to the `fid` of the frame you want to reply to.

@@ -67,0 +67,0 @@ License

@@ -91,3 +91,3 @@ /*

frame.import(ev.data)
ev.data = frame
ev.frame = frame
this.emit("message", event)

@@ -101,2 +101,3 @@ })

this.ws.send(data)
return { frame, data }
}

@@ -103,0 +104,0 @@ }

Sorry, the diff of this file is too big to display

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