@mercuryworkshop/epoxy-transport 2.0.4 → 2.0.6

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,37 +1,38 @@
1
1
  {
2
- "name": "@mercuryworkshop/epoxy-transport",
3
- "version": "2.0.4",
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
- "dependencies": {
10
- "@mercuryworkshop/epoxy-tls": "^2.0.2-1",
11
- "esbuild-plugin-umd-wrapper": "^2.0.0",
12
- "rollup": "^4.12.0",
13
- "rollup-plugin-node-resolve": "^5.2.0",
14
- "rollup-plugin-typescript2": "^0.36.0",
15
- "ws": "8.17.1"
16
- },
17
- "devDependencies": {
18
- "@mercuryworkshop/bare-mux": "^1.1.4",
19
- "esbuild": "^0.19.11",
20
- "esbuild-plugin-d.ts": "^1.2.2"
21
- },
22
- "exports": {
23
- ".": {
24
- "browser": {
25
- "import": "./dist/index.mjs",
26
- "require": "./dist/index.cjs"
27
- },
28
- "node": {
29
- "require": "./lib/index.cjs",
30
- "import": "./lib/index.cjs"
31
- }
32
- }
33
- },
34
- "scripts": {
35
- "build": "node esbuild.bundle.mjs"
36
- }
37
- }
2
+ "name": "@mercuryworkshop/epoxy-transport",
3
+ "version": "2.0.6",
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
+ "prepare": "npm run build"
13
+ },
14
+ "dependencies": {
15
+ "@mercuryworkshop/epoxy-tls": "^2.0.3-4",
16
+ "esbuild-plugin-umd-wrapper": "^2.0.0",
17
+ "rollup": "^4.12.0",
18
+ "rollup-plugin-node-resolve": "^5.2.0",
19
+ "rollup-plugin-typescript2": "^0.36.0"
20
+ },
21
+ "devDependencies": {
22
+ "@mercuryworkshop/bare-mux": "^1.1.4",
23
+ "esbuild": "^0.19.11",
24
+ "esbuild-plugin-d.ts": "^1.2.2"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "browser": {
29
+ "import": "./dist/index.mjs",
30
+ "require": "./dist/index.cjs"
31
+ },
32
+ "node": {
33
+ "require": "./lib/index.cjs",
34
+ "import": "./lib/index.cjs"
35
+ }
36
+ }
37
+ }
38
+ }
package/src/main.ts CHANGED
@@ -6,18 +6,23 @@ export class EpoxyClient implements BareTransport {
6
6
  canstart = true;
7
7
  epxclient: Awaited<ReturnType<any>>["EpoxyClient"]["prototype"] = null!;
8
8
  wisp: string;
9
+ wisp_v2: boolean;
10
+ udp_extension_required: boolean;
9
11
  EpoxyHandlers: Awaited<ReturnType<any>>["EpoxyHandlers"]["prototype"] = null!;
10
12
 
11
- constructor({ wisp }) {
13
+ constructor({ wisp, wisp_v2, udp_extension_required }) {
12
14
  this.wisp = wisp;
15
+ this.wisp_v2 = wisp_v2 || true;
16
+ this.udp_extension_required = udp_extension_required || false;
13
17
  }
14
18
  async init() {
15
19
  const { EpoxyClient, EpoxyClientOptions, EpoxyHandlers } = await epoxy();
16
20
 
17
21
  let options = new EpoxyClientOptions();
18
22
  options.user_agent = navigator.userAgent;
19
- options.udp_extension_required = false;
20
- this.epxclient = await new EpoxyClient(this.wisp, ROOTS, options);
23
+ options.udp_extension_required = this.udp_extension_required;
24
+ options.wisp_v2 = this.wisp_v2;
25
+ this.epxclient = new EpoxyClient(this.wisp, ROOTS, options);
21
26
  this.EpoxyHandlers = EpoxyHandlers;
22
27
 
23
28
  this.ready = true;