chemicaljs 1.0.3 → 1.0.4

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/index.js CHANGED
@@ -3,7 +3,6 @@ import { createServer } from "node:http";
3
3
  import express from "express";
4
4
  import wisp from "wisp-server-node";
5
5
  import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
6
- import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
7
6
  import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
8
7
  import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
9
8
 
@@ -13,7 +12,6 @@ class ChemicalServer {
13
12
  this.app = express();
14
13
  this.app.use(express.static(resolve(import.meta.dirname, "public")));
15
14
  this.app.use("/baremux/", express.static(baremuxPath));
16
- this.app.use("/libcurl/", express.static(libcurlPath));
17
15
  this.app.use("/epoxy/", express.static(epoxyPath));
18
16
  this.app.use("/uv/", express.static(uvPath));
19
17
  this.server.on("request", (req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chemicaljs",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Create your own web proxy using Ultraviolet fast, easy, and no experience required.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,10 +11,9 @@
11
11
  "author": "Nebelung",
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
- "@mercuryworkshop/bare-mux": "^1.1.4",
15
- "@mercuryworkshop/epoxy-transport": "^2.0.6",
16
- "@mercuryworkshop/libcurl-transport": "^1.3.2",
17
- "@titaniumnetwork-dev/ultraviolet": "^3.1.5",
14
+ "@mercuryworkshop/bare-mux": "^2.0.0",
15
+ "@mercuryworkshop/epoxy-transport": "^2.1.0",
16
+ "@titaniumnetwork-dev/ultraviolet": "^3.2.0",
18
17
  "express": "^4.19.2",
19
18
  "wisp-server-node": "^1.1.0"
20
19
  }
@@ -7,12 +7,11 @@ function chemicalEncode(url) {
7
7
  let wispURL = document.currentScript.getAttribute("wisp");
8
8
 
9
9
  async function registerSW() {
10
+ const connection = new window.BareMux.BareMuxConnection("/baremux/worker.js");
11
+ await connection.setTransport("/epoxy/module.js", [{ wisp: wispURL || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/" }]);
12
+
10
13
  if ("serviceWorker" in navigator) {
11
14
  await navigator.serviceWorker.register("/chemical.sw.js");
12
-
13
- await window.BareMux.SetTransport("CurlMod.LibcurlClient", {
14
- wisp: wispURL || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/",
15
- });
16
15
  } else {
17
16
  console.error("Service worker failed to register.")
18
17
  }
@@ -33,9 +32,7 @@ async function loadScript(src) {
33
32
  }
34
33
 
35
34
  (async () => {
36
- await loadScript("/baremux/bare.cjs");
37
- await loadScript("/libcurl/index.js");
38
- await loadScript("/epoxy/index.js");
35
+ await loadScript("/baremux/index.js");
39
36
  await loadScript("/uv/uv.bundle.js");
40
37
  await loadScript("/uv/uv.config.js");
41
38
  await registerSW();