@mercuryworkshop/epoxy-transport 2.1.20 → 2.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,35 +1,34 @@
1
1
  {
2
- "name": "@mercuryworkshop/epoxy-transport",
3
- "version": "2.1.20",
4
- "description": "a bare transport that implements end-to-end encryption with epoxy-tls and wisp",
5
- "main": "./dist/index.mjs",
6
- "keywords": [],
7
- "author": "",
8
- "type": "module",
9
- "license": "AGPL-3.0-only",
10
- "scripts": {
11
- "build": "node esbuild.bundle.mjs",
12
- "prepack": "npm run build"
13
- },
14
- "dependencies": {
15
- "@mercuryworkshop/epoxy-tls": "2.1.11-1"
16
- },
17
- "devDependencies": {
18
- "@mercuryworkshop/bare-mux": "^2.1.3",
19
- "esbuild": "^0.24.0",
20
- "esbuild-plugin-d.ts": "^1.3.1",
21
- "esbuild-plugin-umd-wrapper": "^3.0.0"
22
- },
23
- "exports": {
24
- ".": {
25
- "browser": {
26
- "import": "./dist/index.mjs",
27
- "require": "./dist/index.js"
28
- },
29
- "node": {
30
- "require": "./lib/index.cjs",
31
- "import": "./lib/index.cjs"
32
- }
33
- }
34
- }
35
- }
2
+ "name": "@mercuryworkshop/epoxy-transport",
3
+ "version": "2.1.21",
4
+ "description": "a bare transport that implements end-to-end encryption with epoxy-tls and wisp",
5
+ "main": "./dist/index.mjs",
6
+ "keywords": [],
7
+ "author": "",
8
+ "type": "module",
9
+ "license": "AGPL-3.0-only",
10
+ "dependencies": {
11
+ "@mercuryworkshop/epoxy-tls": "2.1.11-1"
12
+ },
13
+ "devDependencies": {
14
+ "@mercuryworkshop/bare-mux": "^2.1.4",
15
+ "esbuild": "^0.24.0",
16
+ "esbuild-plugin-d.ts": "^1.3.1",
17
+ "esbuild-plugin-umd-wrapper": "^3.0.0"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "browser": {
22
+ "import": "./dist/index.mjs",
23
+ "require": "./dist/index.js"
24
+ },
25
+ "node": {
26
+ "require": "./lib/index.cjs",
27
+ "import": "./lib/index.cjs"
28
+ }
29
+ }
30
+ },
31
+ "scripts": {
32
+ "build": "node esbuild.bundle.mjs"
33
+ }
34
+ }
package/src/main.ts CHANGED
@@ -87,7 +87,6 @@ export default class EpoxyTransport implements BareTransport {
87
87
 
88
88
  connect(
89
89
  url: URL,
90
- origin: string,
91
90
  protocols: string[],
92
91
  requestHeaders: BareHeaders,
93
92
  onopen: (protocol: string) => void,
@@ -106,11 +105,12 @@ export default class EpoxyTransport implements BareTransport {
106
105
  handlers,
107
106
  url.href,
108
107
  protocols,
109
- Object.assign({ "Origin": origin }, requestHeaders)
108
+ Object.assign(requestHeaders)
110
109
  );
111
110
 
112
111
  return [
113
112
  async (data) => {
113
+ if (data instanceof Blob) data = await data.arrayBuffer();
114
114
  (await ws).send(data);
115
115
  },
116
116
  async (code, reason) => {