websocket-framed
Advanced tools
Comparing version 0.9.4 to 0.9.5
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123315
823