Compare commits
No commits in common. "v0.1.0-develop.17" and "v0.1.0-develop.16" have entirely different histories.
v0.1.0-dev
...
v0.1.0-dev
|
@ -1,11 +1,3 @@
|
||||||
# [0.1.0-develop.17](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.16...v0.1.0-develop.17) (2023-09-01)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* browser returns a Blob, so convert to a buffer if we have a blob ([80dd92d](https://git.lumeweb.com/LumeWeb/libs5/commit/80dd92ddb13da043f6f41d34941c81eaf2608e33))
|
|
||||||
* missing uri argument for node WS ([8b7ffa8](https://git.lumeweb.com/LumeWeb/libs5/commit/8b7ffa8821779c769ed2f5772854537675ab5da6))
|
|
||||||
|
|
||||||
# [0.1.0-develop.16](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.15...v0.1.0-develop.16) (2023-09-01)
|
# [0.1.0-develop.16](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.15...v0.1.0-develop.16) (2023-09-01)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.17",
|
"version": "0.1.0-develop.16",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.17",
|
"version": "0.1.0-develop.16",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
"@noble/hashes": "^1.3.1",
|
"@noble/hashes": "^1.3.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.17",
|
"version": "0.1.0-develop.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -24,13 +24,7 @@ export class WebSocketPeer extends BasePeer implements Peer {
|
||||||
this._socket.addEventListener(
|
this._socket.addEventListener(
|
||||||
"message",
|
"message",
|
||||||
async (event: MessageEvent<any>) => {
|
async (event: MessageEvent<any>) => {
|
||||||
let data = event.data;
|
await callback(event.data);
|
||||||
|
|
||||||
if (data instanceof Blob) {
|
|
||||||
data = Buffer.from(await data.arrayBuffer());
|
|
||||||
}
|
|
||||||
|
|
||||||
await callback(data);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -45,7 +39,7 @@ export class WebSocketPeer extends BasePeer implements Peer {
|
||||||
|
|
||||||
public static async connect(uri: URL): Promise<WebSocket> {
|
public static async connect(uri: URL): Promise<WebSocket> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const socket = isNode ? new WS.WebSocket(uri) : new WebSocket(uri);
|
const socket = isNode ? new WS.WebSocket() : new WebSocket(uri);
|
||||||
socket.addEventListener("open", () => {
|
socket.addEventListener("open", () => {
|
||||||
resolve(socket);
|
resolve(socket);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue