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

@mercuryworkshop/epoxy-transport

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mercuryworkshop/epoxy-transport - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

12

package.json
{
"name": "@mercuryworkshop/epoxy-transport",
"version": "2.0.1",
"version": "2.0.2",
"description": "a bare transport that implements end-to-end encryption with epoxy-tls and wisp",

@@ -9,5 +9,2 @@ "main": "./dist/index.mjs",

"type": "module",
"scripts": {
"build": "node esbuild.bundle.mjs"
},
"dependencies": {

@@ -22,3 +19,3 @@ "@mercuryworkshop/epoxy-tls": "^2.0.0-3",

"devDependencies": {
"@mercuryworkshop/bare-mux": "^1.1.1",
"@mercuryworkshop/bare-mux": "^1.1.3",
"esbuild": "^0.19.11",

@@ -38,3 +35,6 @@ "esbuild-plugin-d.ts": "^1.2.2"

}
},
"scripts": {
"build": "node esbuild.bundle.mjs"
}
}
}

@@ -9,2 +9,3 @@ import { BareHeaders, BareResponse, TransferrableResponse, type BareTransport } from "@mercuryworkshop/bare-mux";

wisp: string;
EpoxyHandlers: Awaited<ReturnType<any>>["EpoxyHandlers"]["prototype"] = null!;

@@ -15,3 +16,3 @@ constructor({ wisp }) {

async init() {
const { EpoxyClient, EpoxyClientOptions } = await epoxy();
const { EpoxyClient, EpoxyClientOptions, EpoxyHandlers } = await epoxy();

@@ -22,2 +23,3 @@ let options = new EpoxyClientOptions();

this.epxclient = await new EpoxyClient(this.wisp, ROOTS, options);
this.EpoxyHandlers = EpoxyHandlers;

@@ -62,17 +64,25 @@ this.ready = true;

onerror: (error: string) => void,
): (data: Blob | ArrayBuffer | string) => void {
let epsocket = this.epxclient.connect_ws(
): [ (data: Blob | ArrayBuffer | string) => void, (code: number, reason: string) => void ] {
let handlers = new this.EpoxyHandlers(
onopen,
onclose,
onerror,
(data: Uint8Array | string) => data instanceof Uint8Array ? onmessage(data.buffer) : onmessage(data),
(data: Uint8Array | string) => data instanceof Uint8Array ? onmessage(data.buffer) : onmessage(data)
);
let epsocket = this.epxclient.connect_websocket(
handlers,
url.href,
protocols,
origin,
Object.assign({ "Origin": origin }, requestHeaders)
);
return async (data) => {
await epsocket.send(data);
}
return [
async (data) => {
(await epsocket).send(data);
},
async (code, reason) => {
(await epsocket).close(close, reason)
}
]
}
}

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

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