chemicaljs 1.6.6 → 1.7.0
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/README.md +50 -28
- package/client/chemical.js +60 -13
- package/examples/example/index.js +6 -4
- package/examples/example/package-lock.json +12 -12
- package/examples/example/package.json +1 -1
- package/examples/example-build/package-lock.json +12 -12
- package/examples/example-build/package.json +1 -1
- package/examples/example-components/index.js +5 -3
- package/examples/example-components/package-lock.json +12 -12
- package/examples/example-components/package.json +1 -1
- package/examples/example-styled/index.js +5 -3
- package/examples/example-styled/package-lock.json +12 -12
- package/examples/example-styled/package.json +1 -1
- package/examples/example-vite/index.js +5 -3
- package/examples/example-vite/package-lock.json +96 -92
- package/examples/example-vite/package.json +3 -3
- package/index.js +10 -29
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Chemical
|
|
2
2
|
Easily create your own web proxy with no experience required.
|
|
3
3
|
|
|
4
|
+
> [!IMPORTANT]
|
|
5
|
+
> I am in the process of creating a documentation site. These docs might be outdated.
|
|
6
|
+
|
|
4
7
|
## Setup
|
|
5
8
|
|
|
6
9
|
A simple example can be found in [`/example/`](https://github.com/chemicaljs/chemical/tree/main/examples/example).
|
|
@@ -25,13 +28,13 @@ Create a new Node.js project and create a script file for the server.
|
|
|
25
28
|
```js
|
|
26
29
|
import { ChemicalServer } from "chemicaljs";
|
|
27
30
|
|
|
28
|
-
const
|
|
31
|
+
const [app, listen] = new ChemicalServer();
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
You can pass options to disable proxy services and set the default service.
|
|
32
35
|
|
|
33
36
|
```js
|
|
34
|
-
const
|
|
37
|
+
const [app, listen] = new ChemicalServer({
|
|
35
38
|
default: "rammerhead",
|
|
36
39
|
uv: true,
|
|
37
40
|
scramjet: false,
|
|
@@ -43,7 +46,7 @@ const chemical = new ChemicalServer({
|
|
|
43
46
|
|
|
44
47
|
`hostname_whitelist` overrides `hostname_blacklist` if you try to set them both.
|
|
45
48
|
|
|
46
|
-
3. Use `
|
|
49
|
+
3. Use `app` which is an express app. You may need to import express for certain APIs.
|
|
47
50
|
|
|
48
51
|
```js
|
|
49
52
|
chemical.get("/", function(req, res){
|
|
@@ -51,20 +54,21 @@ chemical.get("/", function(req, res){
|
|
|
51
54
|
});
|
|
52
55
|
```
|
|
53
56
|
|
|
57
|
+
4. Use `app.serveChemical()` to serve Chemical routes.
|
|
54
58
|
|
|
55
|
-
5.
|
|
59
|
+
5. Use `serveChemical` after main routes but before 404 routes. Example 404 page.
|
|
56
60
|
|
|
57
61
|
```js
|
|
58
|
-
|
|
62
|
+
app.use((req, res) => {
|
|
59
63
|
res.status(404);
|
|
60
64
|
res.send("404 Error");
|
|
61
65
|
});
|
|
62
66
|
```
|
|
63
67
|
|
|
64
|
-
4. Use `
|
|
68
|
+
4. Use `listen` on a port of your choosing.
|
|
65
69
|
|
|
66
70
|
```js
|
|
67
|
-
|
|
71
|
+
listen(3000);
|
|
68
72
|
```
|
|
69
73
|
|
|
70
74
|
Below is an example of a simple backend. This example will setup Chemical and serve the "public" folder along with the `index.html` file as `/` and `.html` files without the extension.
|
|
@@ -74,20 +78,22 @@ Below is an example of a simple backend. This example will setup Chemical and se
|
|
|
74
78
|
import { ChemicalServer } from "chemicaljs";
|
|
75
79
|
import express from "express";
|
|
76
80
|
|
|
77
|
-
const
|
|
81
|
+
const [app, listen] = new ChemicalServer();
|
|
78
82
|
const port = process.env.PORT || 3000;
|
|
79
83
|
|
|
80
|
-
|
|
84
|
+
app.use(express.static("public", {
|
|
81
85
|
index: "index.html",
|
|
82
86
|
extensions: ["html"]
|
|
83
87
|
}));
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
app.serveChemical();
|
|
90
|
+
|
|
91
|
+
app.use((req, res) => {
|
|
86
92
|
res.status(404);
|
|
87
93
|
res.send("404 Error");
|
|
88
94
|
});
|
|
89
95
|
|
|
90
|
-
|
|
96
|
+
listen(port, () => {
|
|
91
97
|
console.log(`Chemical demo listening on port ${port}`);
|
|
92
98
|
});
|
|
93
99
|
```
|
|
@@ -150,22 +156,40 @@ If you want to set the transport just change the `transport` attribute. Choose `
|
|
|
150
156
|
<script data-transport="epoxy" src="/chemical.js"></script>
|
|
151
157
|
```
|
|
152
158
|
|
|
153
|
-
2. In a inline script or javascript file, encode a URL with Chemical using the async function `
|
|
159
|
+
2. In a inline script or javascript file, encode a URL with Chemical using the async function `chemical.encode`.
|
|
154
160
|
|
|
155
161
|
```js
|
|
156
|
-
await
|
|
162
|
+
await chemical.encode("https://example.com")
|
|
157
163
|
```
|
|
158
164
|
|
|
159
165
|
Optional: Change service to `uv`, `scramjet`, or `rammerhead`. Defaults to `uv` or server option.
|
|
160
166
|
|
|
161
167
|
```js
|
|
162
|
-
await
|
|
168
|
+
await chemical.encode("https://example.com", {
|
|
169
|
+
service: "rammerhead"
|
|
170
|
+
})
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
4. Set `autoHttps` to make `example.com` > `https://example.com`
|
|
174
|
+
|
|
175
|
+
```js
|
|
176
|
+
await chemical.encode("example.com", {
|
|
177
|
+
autoHttps: true
|
|
178
|
+
})
|
|
163
179
|
```
|
|
164
180
|
|
|
165
|
-
|
|
181
|
+
5. Use a search engine with the `searchEngine` property. Use a search engine URL with "%s" in place of query.
|
|
166
182
|
|
|
167
183
|
```js
|
|
168
|
-
|
|
184
|
+
await chemical.encode("cheese", {
|
|
185
|
+
searchEngine: "https://www.google.com/search?q=%s"
|
|
186
|
+
})
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
6. You may want to check if Chemical has loaded before encoding a URL.
|
|
190
|
+
|
|
191
|
+
```js
|
|
192
|
+
if (window.chemical.loaded) {
|
|
169
193
|
//Chemical is loaded
|
|
170
194
|
}
|
|
171
195
|
```
|
|
@@ -176,10 +200,16 @@ window.addEventListener("chemicalLoaded", function(e) {
|
|
|
176
200
|
});
|
|
177
201
|
```
|
|
178
202
|
|
|
179
|
-
|
|
203
|
+
7. Change the transport with `chemical.setTransport`
|
|
180
204
|
|
|
181
205
|
```js
|
|
182
|
-
await
|
|
206
|
+
await chemical.setTransport("libcurl") //libcurl or epoxy
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
8. Change the Wisp URL with `chemical.setWisp`
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
await chemical.setWisp("wss://wisp.mercurywork.shop/")
|
|
183
213
|
```
|
|
184
214
|
|
|
185
215
|
Below is a simple example of a simple input that redirects to the encoded URL when the user presses enter. It checks if there is any input and if Chemical has loaded before loading.
|
|
@@ -193,8 +223,8 @@ Below is a simple example of a simple input that redirects to the encoded URL wh
|
|
|
193
223
|
const search = document.getElementById("search");
|
|
194
224
|
|
|
195
225
|
search.addEventListener("keydown", async function (e) {
|
|
196
|
-
if (e.key == "Enter" &&
|
|
197
|
-
window.location = await
|
|
226
|
+
if (e.key == "Enter" && chemical.loaded && e.target.value) {
|
|
227
|
+
window.location = await chemical.encode(e.target.value)
|
|
198
228
|
}
|
|
199
229
|
})
|
|
200
230
|
</script>
|
|
@@ -321,13 +351,5 @@ Set the second parameter of `chemicalAction` to the `id` of the iframe.
|
|
|
321
351
|
<iframe controls="my-controls-2" id="my-iframe-2" is="chemical-iframe"></iframe>
|
|
322
352
|
```
|
|
323
353
|
|
|
324
|
-
## Future Additions
|
|
325
|
-
|
|
326
|
-
- Automatically add https:// if needed
|
|
327
|
-
- Search engine option for search
|
|
328
|
-
- Easy tab cloaking
|
|
329
|
-
- Easy about:blank
|
|
330
|
-
- Proxy switcher/searchengine switcher/cloak switcher
|
|
331
|
-
|
|
332
354
|
## License
|
|
333
355
|
Chemical uses the AGPL 3.0 license.
|
package/client/chemical.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
window.
|
|
1
|
+
window.chemical = {
|
|
2
|
+
loaded: false,
|
|
3
|
+
transport: document.currentScript.dataset.transport || "libcurl",
|
|
4
|
+
wisp: document.currentScript.dataset.wisp || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/"
|
|
5
|
+
}
|
|
2
6
|
|
|
3
7
|
function rammerheadEncode(baseUrl) {
|
|
4
8
|
const mod = (n, m) => ((n % m) + m) % m
|
|
@@ -174,7 +178,7 @@ function rammerheadEncode(baseUrl) {
|
|
|
174
178
|
})
|
|
175
179
|
}
|
|
176
180
|
|
|
177
|
-
async function
|
|
181
|
+
async function encodeService(url, service) {
|
|
178
182
|
switch (service) {
|
|
179
183
|
case "uv":
|
|
180
184
|
if (uvEnabled) {
|
|
@@ -193,7 +197,7 @@ async function chemicalEncode(url, service = defaultService) {
|
|
|
193
197
|
case "scramjet":
|
|
194
198
|
if (scramjetEnabled) {
|
|
195
199
|
return (
|
|
196
|
-
|
|
200
|
+
"https://proxysite.com" +
|
|
197
201
|
window.__scramjet$config.prefix +
|
|
198
202
|
window.__scramjet$config.codec.encode(url)
|
|
199
203
|
);
|
|
@@ -202,8 +206,28 @@ async function chemicalEncode(url, service = defaultService) {
|
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
208
|
|
|
209
|
+
window.chemical.encode = async function (url, config) {
|
|
210
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) {
|
|
211
|
+
config = {
|
|
212
|
+
service: defaultService,
|
|
213
|
+
autoHttps: false
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (url.match(/^https?:\/\//)) {
|
|
218
|
+
return await encodeService(url, config.service);
|
|
219
|
+
} else if (config.autoHttps == true && (url.includes(".") && !url.includes(" "))) {
|
|
220
|
+
return await encodeService("https://" + url, config.service);
|
|
221
|
+
} else if (config.searchEngine) {
|
|
222
|
+
return await encodeService(config.searchEngine.replace("%s", encodeURIComponent(url)), config.service);
|
|
223
|
+
} else {
|
|
224
|
+
return await encodeService(url, config.service);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
205
228
|
function getTransport(transport) {
|
|
206
229
|
switch (transport) {
|
|
230
|
+
default:
|
|
207
231
|
case "libcurl":
|
|
208
232
|
return "/libcurl/index.mjs"
|
|
209
233
|
break;
|
|
@@ -213,19 +237,17 @@ function getTransport(transport) {
|
|
|
213
237
|
}
|
|
214
238
|
}
|
|
215
239
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
240
|
+
window.chemical.setTransport = async function (newTransport = window.chemical.transport) {
|
|
241
|
+
await window.chemical.connection.setTransport(getTransport(newTransport), [{ wisp: window.chemical.wisp }]);
|
|
242
|
+
window.chemical.transport = newTransport;
|
|
243
|
+
}
|
|
220
244
|
|
|
221
|
-
async function
|
|
222
|
-
await connection.setTransport(getTransport(
|
|
245
|
+
window.chemical.setWisp = async function (wisp = window.chemical.wisp) {
|
|
246
|
+
await window.chemical.connection.setTransport(getTransport(window.chemical.transport), [{ wisp: wisp }]);
|
|
247
|
+
window.chemical.wisp = wisp;
|
|
223
248
|
}
|
|
224
249
|
|
|
225
250
|
async function registerSW() {
|
|
226
|
-
connection = new window.BareMux.BareMuxConnection("/baremux/worker.js");
|
|
227
|
-
await chemicalTransport();
|
|
228
|
-
|
|
229
251
|
if ("serviceWorker" in navigator) {
|
|
230
252
|
await navigator.serviceWorker.register("/chemical.sw.js");
|
|
231
253
|
} else {
|
|
@@ -247,6 +269,28 @@ async function loadScript(src) {
|
|
|
247
269
|
});
|
|
248
270
|
}
|
|
249
271
|
|
|
272
|
+
function setupFetch() {
|
|
273
|
+
const client = new window.BareMux.BareClient();
|
|
274
|
+
window.chemical.fetch = client.fetch.bind(client);
|
|
275
|
+
|
|
276
|
+
window.chemical.getSuggestions = async function (query) {
|
|
277
|
+
if (!query) {
|
|
278
|
+
return [];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
try {
|
|
282
|
+
const DDGSuggestions = await window.chemical.fetch(
|
|
283
|
+
"https://duckduckgo.com/ac/?q=" + query + "&type=list"
|
|
284
|
+
);
|
|
285
|
+
const suggestions = await DDGSuggestions.json();
|
|
286
|
+
return suggestions[1].slice(0, 9);
|
|
287
|
+
} catch (err) {
|
|
288
|
+
console.error(err);
|
|
289
|
+
return [];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
250
294
|
(async () => {
|
|
251
295
|
await loadScript("/baremux/index.js");
|
|
252
296
|
if (uvEnabled) {
|
|
@@ -257,7 +301,10 @@ async function loadScript(src) {
|
|
|
257
301
|
await loadScript("/scramjet/scramjet.codecs.js");
|
|
258
302
|
await loadScript("/scramjet/scramjet.config.js");
|
|
259
303
|
}
|
|
304
|
+
window.chemical.connection = new window.BareMux.BareMuxConnection("/baremux/worker.js");
|
|
305
|
+
await window.chemical.setTransport();
|
|
306
|
+
setupFetch();
|
|
260
307
|
await registerSW();
|
|
261
|
-
|
|
308
|
+
window.chemical.loaded = true;
|
|
262
309
|
window.dispatchEvent(new Event("chemicalLoaded"));
|
|
263
310
|
})();
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { ChemicalServer } from "chemicaljs";
|
|
2
2
|
import express from "express";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const [app, listen] = new ChemicalServer();
|
|
5
5
|
const port = process.env.PORT || 3000;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
app.use(express.static("public", {
|
|
8
8
|
index: "index.html",
|
|
9
9
|
extensions: ["html"]
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
app.serveChemical();
|
|
13
|
+
|
|
14
|
+
app.use((req, res) => {
|
|
13
15
|
res.status(404);
|
|
14
16
|
res.send("404 Error");
|
|
15
17
|
});
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
listen(port, () => {
|
|
18
20
|
console.log(`Chemical example listening on port ${port}`);
|
|
19
21
|
});
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.6.
|
|
12
|
+
"chemicaljs": "^1.6.7",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -409,16 +409,16 @@
|
|
|
409
409
|
"integrity": "sha512-Y5jByKQ/5ZhyKd3adHUQ18nB+HOUpopxRXIJh6KHXEq4rkG2AazHyMm42dvtAxHvkKlHkLxR7/5oxKZSD6rE4A=="
|
|
410
410
|
},
|
|
411
411
|
"node_modules/@mercuryworkshop/epoxy-tls": {
|
|
412
|
-
"version": "2.1.
|
|
413
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.
|
|
414
|
-
"integrity": "sha512-
|
|
412
|
+
"version": "2.1.2-1",
|
|
413
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.2-1.tgz",
|
|
414
|
+
"integrity": "sha512-qt6UOEZcVMYblFwOKaNAZHoDHSYN3JZ5Z6BvRHKB6zo1DFMub+cPuYQ+Aauib7LmIabYWZi2cMyfO5VsNLDYoA=="
|
|
415
415
|
},
|
|
416
416
|
"node_modules/@mercuryworkshop/epoxy-transport": {
|
|
417
|
-
"version": "2.1.
|
|
418
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.
|
|
419
|
-
"integrity": "sha512-
|
|
417
|
+
"version": "2.1.8",
|
|
418
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.8.tgz",
|
|
419
|
+
"integrity": "sha512-quBpEDb3mRxQOl7S6NkT6qFoII+cmBVNOC9/58hN7A4WIg6Q11d+FgAygDLWq5yESgtmDKujZjBVA2XQ6OkLgQ==",
|
|
420
420
|
"dependencies": {
|
|
421
|
-
"@mercuryworkshop/epoxy-tls": "2.1.
|
|
421
|
+
"@mercuryworkshop/epoxy-tls": "2.1.2-1"
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
424
|
"node_modules/@mercuryworkshop/libcurl-transport": {
|
|
@@ -1163,12 +1163,12 @@
|
|
|
1163
1163
|
}
|
|
1164
1164
|
},
|
|
1165
1165
|
"node_modules/chemicaljs": {
|
|
1166
|
-
"version": "1.6.
|
|
1167
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.
|
|
1168
|
-
"integrity": "sha512-
|
|
1166
|
+
"version": "1.6.7",
|
|
1167
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.7.tgz",
|
|
1168
|
+
"integrity": "sha512-3BaUpDAaHRD4GiE3MVfJ1cB0lxWx4cojOs/XN3SePmfm96DGjjvWEEpSikoC97yJe2XrNi7JLtASTB1Dk4af9g==",
|
|
1169
1169
|
"dependencies": {
|
|
1170
1170
|
"@mercuryworkshop/bare-mux": "^2.0.4",
|
|
1171
|
-
"@mercuryworkshop/epoxy-transport": "^2.1.
|
|
1171
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.8",
|
|
1172
1172
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
|
1173
1173
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1174
1174
|
"@mercuryworkshop/wisp-js": "^0.1.1",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.6.
|
|
12
|
+
"chemicaljs": "^1.6.7",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -409,16 +409,16 @@
|
|
|
409
409
|
"integrity": "sha512-Y5jByKQ/5ZhyKd3adHUQ18nB+HOUpopxRXIJh6KHXEq4rkG2AazHyMm42dvtAxHvkKlHkLxR7/5oxKZSD6rE4A=="
|
|
410
410
|
},
|
|
411
411
|
"node_modules/@mercuryworkshop/epoxy-tls": {
|
|
412
|
-
"version": "2.1.
|
|
413
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.
|
|
414
|
-
"integrity": "sha512-
|
|
412
|
+
"version": "2.1.2-1",
|
|
413
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.2-1.tgz",
|
|
414
|
+
"integrity": "sha512-qt6UOEZcVMYblFwOKaNAZHoDHSYN3JZ5Z6BvRHKB6zo1DFMub+cPuYQ+Aauib7LmIabYWZi2cMyfO5VsNLDYoA=="
|
|
415
415
|
},
|
|
416
416
|
"node_modules/@mercuryworkshop/epoxy-transport": {
|
|
417
|
-
"version": "2.1.
|
|
418
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.
|
|
419
|
-
"integrity": "sha512-
|
|
417
|
+
"version": "2.1.8",
|
|
418
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.8.tgz",
|
|
419
|
+
"integrity": "sha512-quBpEDb3mRxQOl7S6NkT6qFoII+cmBVNOC9/58hN7A4WIg6Q11d+FgAygDLWq5yESgtmDKujZjBVA2XQ6OkLgQ==",
|
|
420
420
|
"dependencies": {
|
|
421
|
-
"@mercuryworkshop/epoxy-tls": "2.1.
|
|
421
|
+
"@mercuryworkshop/epoxy-tls": "2.1.2-1"
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
424
|
"node_modules/@mercuryworkshop/libcurl-transport": {
|
|
@@ -1163,12 +1163,12 @@
|
|
|
1163
1163
|
}
|
|
1164
1164
|
},
|
|
1165
1165
|
"node_modules/chemicaljs": {
|
|
1166
|
-
"version": "1.6.
|
|
1167
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.
|
|
1168
|
-
"integrity": "sha512-
|
|
1166
|
+
"version": "1.6.7",
|
|
1167
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.7.tgz",
|
|
1168
|
+
"integrity": "sha512-3BaUpDAaHRD4GiE3MVfJ1cB0lxWx4cojOs/XN3SePmfm96DGjjvWEEpSikoC97yJe2XrNi7JLtASTB1Dk4af9g==",
|
|
1169
1169
|
"dependencies": {
|
|
1170
1170
|
"@mercuryworkshop/bare-mux": "^2.0.4",
|
|
1171
|
-
"@mercuryworkshop/epoxy-transport": "^2.1.
|
|
1171
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.8",
|
|
1172
1172
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
|
1173
1173
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1174
1174
|
"@mercuryworkshop/wisp-js": "^0.1.1",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ChemicalServer } from "chemicaljs";
|
|
2
2
|
import express from "express";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const [app, listen] = new ChemicalServer();
|
|
5
5
|
const port = process.env.PORT || 3000;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
app.use(express.static("public", {
|
|
8
8
|
index: "index.html",
|
|
9
9
|
extensions: ["html"]
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
app.serveChemical();
|
|
13
|
+
|
|
14
|
+
listen(port, () => {
|
|
13
15
|
console.log(`Chemical example components listening on port ${port}`);
|
|
14
16
|
});
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.6.
|
|
12
|
+
"chemicaljs": "^1.6.7",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -409,16 +409,16 @@
|
|
|
409
409
|
"integrity": "sha512-Y5jByKQ/5ZhyKd3adHUQ18nB+HOUpopxRXIJh6KHXEq4rkG2AazHyMm42dvtAxHvkKlHkLxR7/5oxKZSD6rE4A=="
|
|
410
410
|
},
|
|
411
411
|
"node_modules/@mercuryworkshop/epoxy-tls": {
|
|
412
|
-
"version": "2.1.
|
|
413
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.
|
|
414
|
-
"integrity": "sha512-
|
|
412
|
+
"version": "2.1.2-1",
|
|
413
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.2-1.tgz",
|
|
414
|
+
"integrity": "sha512-qt6UOEZcVMYblFwOKaNAZHoDHSYN3JZ5Z6BvRHKB6zo1DFMub+cPuYQ+Aauib7LmIabYWZi2cMyfO5VsNLDYoA=="
|
|
415
415
|
},
|
|
416
416
|
"node_modules/@mercuryworkshop/epoxy-transport": {
|
|
417
|
-
"version": "2.1.
|
|
418
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.
|
|
419
|
-
"integrity": "sha512-
|
|
417
|
+
"version": "2.1.8",
|
|
418
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.8.tgz",
|
|
419
|
+
"integrity": "sha512-quBpEDb3mRxQOl7S6NkT6qFoII+cmBVNOC9/58hN7A4WIg6Q11d+FgAygDLWq5yESgtmDKujZjBVA2XQ6OkLgQ==",
|
|
420
420
|
"dependencies": {
|
|
421
|
-
"@mercuryworkshop/epoxy-tls": "2.1.
|
|
421
|
+
"@mercuryworkshop/epoxy-tls": "2.1.2-1"
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
424
|
"node_modules/@mercuryworkshop/libcurl-transport": {
|
|
@@ -1163,12 +1163,12 @@
|
|
|
1163
1163
|
}
|
|
1164
1164
|
},
|
|
1165
1165
|
"node_modules/chemicaljs": {
|
|
1166
|
-
"version": "1.6.
|
|
1167
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.
|
|
1168
|
-
"integrity": "sha512-
|
|
1166
|
+
"version": "1.6.7",
|
|
1167
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.7.tgz",
|
|
1168
|
+
"integrity": "sha512-3BaUpDAaHRD4GiE3MVfJ1cB0lxWx4cojOs/XN3SePmfm96DGjjvWEEpSikoC97yJe2XrNi7JLtASTB1Dk4af9g==",
|
|
1169
1169
|
"dependencies": {
|
|
1170
1170
|
"@mercuryworkshop/bare-mux": "^2.0.4",
|
|
1171
|
-
"@mercuryworkshop/epoxy-transport": "^2.1.
|
|
1171
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.8",
|
|
1172
1172
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
|
1173
1173
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1174
1174
|
"@mercuryworkshop/wisp-js": "^0.1.1",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ChemicalServer } from "chemicaljs";
|
|
2
2
|
import express from "express";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const [app, listen] = new ChemicalServer();
|
|
5
5
|
const port = process.env.PORT || 3000;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
app.use(express.static("public", {
|
|
8
8
|
index: "index.html",
|
|
9
9
|
extensions: ["html"]
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
app.serveChemical();
|
|
13
|
+
|
|
14
|
+
listen(port, () => {
|
|
13
15
|
console.log(`Chemical example styled listening on port ${port}`);
|
|
14
16
|
});
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.6.
|
|
12
|
+
"chemicaljs": "^1.6.7",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -409,16 +409,16 @@
|
|
|
409
409
|
"integrity": "sha512-Y5jByKQ/5ZhyKd3adHUQ18nB+HOUpopxRXIJh6KHXEq4rkG2AazHyMm42dvtAxHvkKlHkLxR7/5oxKZSD6rE4A=="
|
|
410
410
|
},
|
|
411
411
|
"node_modules/@mercuryworkshop/epoxy-tls": {
|
|
412
|
-
"version": "2.1.
|
|
413
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.
|
|
414
|
-
"integrity": "sha512-
|
|
412
|
+
"version": "2.1.2-1",
|
|
413
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.2-1.tgz",
|
|
414
|
+
"integrity": "sha512-qt6UOEZcVMYblFwOKaNAZHoDHSYN3JZ5Z6BvRHKB6zo1DFMub+cPuYQ+Aauib7LmIabYWZi2cMyfO5VsNLDYoA=="
|
|
415
415
|
},
|
|
416
416
|
"node_modules/@mercuryworkshop/epoxy-transport": {
|
|
417
|
-
"version": "2.1.
|
|
418
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.
|
|
419
|
-
"integrity": "sha512-
|
|
417
|
+
"version": "2.1.8",
|
|
418
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.8.tgz",
|
|
419
|
+
"integrity": "sha512-quBpEDb3mRxQOl7S6NkT6qFoII+cmBVNOC9/58hN7A4WIg6Q11d+FgAygDLWq5yESgtmDKujZjBVA2XQ6OkLgQ==",
|
|
420
420
|
"dependencies": {
|
|
421
|
-
"@mercuryworkshop/epoxy-tls": "2.1.
|
|
421
|
+
"@mercuryworkshop/epoxy-tls": "2.1.2-1"
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
424
|
"node_modules/@mercuryworkshop/libcurl-transport": {
|
|
@@ -1163,12 +1163,12 @@
|
|
|
1163
1163
|
}
|
|
1164
1164
|
},
|
|
1165
1165
|
"node_modules/chemicaljs": {
|
|
1166
|
-
"version": "1.6.
|
|
1167
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.
|
|
1168
|
-
"integrity": "sha512-
|
|
1166
|
+
"version": "1.6.7",
|
|
1167
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.7.tgz",
|
|
1168
|
+
"integrity": "sha512-3BaUpDAaHRD4GiE3MVfJ1cB0lxWx4cojOs/XN3SePmfm96DGjjvWEEpSikoC97yJe2XrNi7JLtASTB1Dk4af9g==",
|
|
1169
1169
|
"dependencies": {
|
|
1170
1170
|
"@mercuryworkshop/bare-mux": "^2.0.4",
|
|
1171
|
-
"@mercuryworkshop/epoxy-transport": "^2.1.
|
|
1171
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.8",
|
|
1172
1172
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
|
1173
1173
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1174
1174
|
"@mercuryworkshop/wisp-js": "^0.1.1",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ChemicalServer } from "chemicaljs";
|
|
2
2
|
import express from "express";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const [app, listen] = new ChemicalServer();
|
|
5
5
|
const port = process.env.PORT || 3000;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
app.use(express.static("dist", {
|
|
8
8
|
index: "index.html",
|
|
9
9
|
extensions: ["html"]
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
app.serveChemical();
|
|
13
|
+
|
|
14
|
+
listen(port, () => {
|
|
13
15
|
console.log(`Chemical example vite listening on port ${port}`);
|
|
14
16
|
});
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"": {
|
|
7
7
|
"name": "chemical-example-vite",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"chemicaljs": "^1.6.
|
|
9
|
+
"chemicaljs": "^1.6.7",
|
|
10
10
|
"express": "^4.19.2",
|
|
11
|
-
"preact": "^10.23.
|
|
11
|
+
"preact": "^10.23.2"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@preact/preset-vite": "^2.9.0",
|
|
15
|
-
"vite": "^5.
|
|
15
|
+
"vite": "^5.4.2"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"node_modules/@ampproject/remapping": {
|
|
@@ -796,16 +796,16 @@
|
|
|
796
796
|
"integrity": "sha512-Y5jByKQ/5ZhyKd3adHUQ18nB+HOUpopxRXIJh6KHXEq4rkG2AazHyMm42dvtAxHvkKlHkLxR7/5oxKZSD6rE4A=="
|
|
797
797
|
},
|
|
798
798
|
"node_modules/@mercuryworkshop/epoxy-tls": {
|
|
799
|
-
"version": "2.1.
|
|
800
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.
|
|
801
|
-
"integrity": "sha512-
|
|
799
|
+
"version": "2.1.2-1",
|
|
800
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-tls/-/epoxy-tls-2.1.2-1.tgz",
|
|
801
|
+
"integrity": "sha512-qt6UOEZcVMYblFwOKaNAZHoDHSYN3JZ5Z6BvRHKB6zo1DFMub+cPuYQ+Aauib7LmIabYWZi2cMyfO5VsNLDYoA=="
|
|
802
802
|
},
|
|
803
803
|
"node_modules/@mercuryworkshop/epoxy-transport": {
|
|
804
|
-
"version": "2.1.
|
|
805
|
-
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.
|
|
806
|
-
"integrity": "sha512-
|
|
804
|
+
"version": "2.1.8",
|
|
805
|
+
"resolved": "https://registry.npmjs.org/@mercuryworkshop/epoxy-transport/-/epoxy-transport-2.1.8.tgz",
|
|
806
|
+
"integrity": "sha512-quBpEDb3mRxQOl7S6NkT6qFoII+cmBVNOC9/58hN7A4WIg6Q11d+FgAygDLWq5yESgtmDKujZjBVA2XQ6OkLgQ==",
|
|
807
807
|
"dependencies": {
|
|
808
|
-
"@mercuryworkshop/epoxy-tls": "2.1.
|
|
808
|
+
"@mercuryworkshop/epoxy-tls": "2.1.2-1"
|
|
809
809
|
}
|
|
810
810
|
},
|
|
811
811
|
"node_modules/@mercuryworkshop/libcurl-transport": {
|
|
@@ -979,9 +979,9 @@
|
|
|
979
979
|
}
|
|
980
980
|
},
|
|
981
981
|
"node_modules/@rollup/rollup-android-arm-eabi": {
|
|
982
|
-
"version": "4.
|
|
983
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.
|
|
984
|
-
"integrity": "sha512-
|
|
982
|
+
"version": "4.21.0",
|
|
983
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz",
|
|
984
|
+
"integrity": "sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==",
|
|
985
985
|
"cpu": [
|
|
986
986
|
"arm"
|
|
987
987
|
],
|
|
@@ -991,9 +991,9 @@
|
|
|
991
991
|
]
|
|
992
992
|
},
|
|
993
993
|
"node_modules/@rollup/rollup-android-arm64": {
|
|
994
|
-
"version": "4.
|
|
995
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.
|
|
996
|
-
"integrity": "sha512-
|
|
994
|
+
"version": "4.21.0",
|
|
995
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz",
|
|
996
|
+
"integrity": "sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==",
|
|
997
997
|
"cpu": [
|
|
998
998
|
"arm64"
|
|
999
999
|
],
|
|
@@ -1003,9 +1003,9 @@
|
|
|
1003
1003
|
]
|
|
1004
1004
|
},
|
|
1005
1005
|
"node_modules/@rollup/rollup-darwin-arm64": {
|
|
1006
|
-
"version": "4.
|
|
1007
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.
|
|
1008
|
-
"integrity": "sha512-
|
|
1006
|
+
"version": "4.21.0",
|
|
1007
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz",
|
|
1008
|
+
"integrity": "sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==",
|
|
1009
1009
|
"cpu": [
|
|
1010
1010
|
"arm64"
|
|
1011
1011
|
],
|
|
@@ -1015,9 +1015,9 @@
|
|
|
1015
1015
|
]
|
|
1016
1016
|
},
|
|
1017
1017
|
"node_modules/@rollup/rollup-darwin-x64": {
|
|
1018
|
-
"version": "4.
|
|
1019
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.
|
|
1020
|
-
"integrity": "sha512-
|
|
1018
|
+
"version": "4.21.0",
|
|
1019
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz",
|
|
1020
|
+
"integrity": "sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==",
|
|
1021
1021
|
"cpu": [
|
|
1022
1022
|
"x64"
|
|
1023
1023
|
],
|
|
@@ -1027,9 +1027,9 @@
|
|
|
1027
1027
|
]
|
|
1028
1028
|
},
|
|
1029
1029
|
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
|
1030
|
-
"version": "4.
|
|
1031
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.
|
|
1032
|
-
"integrity": "sha512-
|
|
1030
|
+
"version": "4.21.0",
|
|
1031
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz",
|
|
1032
|
+
"integrity": "sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==",
|
|
1033
1033
|
"cpu": [
|
|
1034
1034
|
"arm"
|
|
1035
1035
|
],
|
|
@@ -1039,9 +1039,9 @@
|
|
|
1039
1039
|
]
|
|
1040
1040
|
},
|
|
1041
1041
|
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
|
1042
|
-
"version": "4.
|
|
1043
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.
|
|
1044
|
-
"integrity": "sha512-
|
|
1042
|
+
"version": "4.21.0",
|
|
1043
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz",
|
|
1044
|
+
"integrity": "sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==",
|
|
1045
1045
|
"cpu": [
|
|
1046
1046
|
"arm"
|
|
1047
1047
|
],
|
|
@@ -1051,9 +1051,9 @@
|
|
|
1051
1051
|
]
|
|
1052
1052
|
},
|
|
1053
1053
|
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
|
1054
|
-
"version": "4.
|
|
1055
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.
|
|
1056
|
-
"integrity": "sha512-
|
|
1054
|
+
"version": "4.21.0",
|
|
1055
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz",
|
|
1056
|
+
"integrity": "sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==",
|
|
1057
1057
|
"cpu": [
|
|
1058
1058
|
"arm64"
|
|
1059
1059
|
],
|
|
@@ -1063,9 +1063,9 @@
|
|
|
1063
1063
|
]
|
|
1064
1064
|
},
|
|
1065
1065
|
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
|
1066
|
-
"version": "4.
|
|
1067
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.
|
|
1068
|
-
"integrity": "sha512-
|
|
1066
|
+
"version": "4.21.0",
|
|
1067
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz",
|
|
1068
|
+
"integrity": "sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==",
|
|
1069
1069
|
"cpu": [
|
|
1070
1070
|
"arm64"
|
|
1071
1071
|
],
|
|
@@ -1075,9 +1075,9 @@
|
|
|
1075
1075
|
]
|
|
1076
1076
|
},
|
|
1077
1077
|
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
|
|
1078
|
-
"version": "4.
|
|
1079
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.
|
|
1080
|
-
"integrity": "sha512-
|
|
1078
|
+
"version": "4.21.0",
|
|
1079
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz",
|
|
1080
|
+
"integrity": "sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==",
|
|
1081
1081
|
"cpu": [
|
|
1082
1082
|
"ppc64"
|
|
1083
1083
|
],
|
|
@@ -1087,9 +1087,9 @@
|
|
|
1087
1087
|
]
|
|
1088
1088
|
},
|
|
1089
1089
|
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
|
1090
|
-
"version": "4.
|
|
1091
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.
|
|
1092
|
-
"integrity": "sha512-
|
|
1090
|
+
"version": "4.21.0",
|
|
1091
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz",
|
|
1092
|
+
"integrity": "sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==",
|
|
1093
1093
|
"cpu": [
|
|
1094
1094
|
"riscv64"
|
|
1095
1095
|
],
|
|
@@ -1099,9 +1099,9 @@
|
|
|
1099
1099
|
]
|
|
1100
1100
|
},
|
|
1101
1101
|
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
|
1102
|
-
"version": "4.
|
|
1103
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.
|
|
1104
|
-
"integrity": "sha512-
|
|
1102
|
+
"version": "4.21.0",
|
|
1103
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz",
|
|
1104
|
+
"integrity": "sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==",
|
|
1105
1105
|
"cpu": [
|
|
1106
1106
|
"s390x"
|
|
1107
1107
|
],
|
|
@@ -1111,9 +1111,9 @@
|
|
|
1111
1111
|
]
|
|
1112
1112
|
},
|
|
1113
1113
|
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
|
1114
|
-
"version": "4.
|
|
1115
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.
|
|
1116
|
-
"integrity": "sha512-
|
|
1114
|
+
"version": "4.21.0",
|
|
1115
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz",
|
|
1116
|
+
"integrity": "sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==",
|
|
1117
1117
|
"cpu": [
|
|
1118
1118
|
"x64"
|
|
1119
1119
|
],
|
|
@@ -1123,9 +1123,9 @@
|
|
|
1123
1123
|
]
|
|
1124
1124
|
},
|
|
1125
1125
|
"node_modules/@rollup/rollup-linux-x64-musl": {
|
|
1126
|
-
"version": "4.
|
|
1127
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.
|
|
1128
|
-
"integrity": "sha512-
|
|
1126
|
+
"version": "4.21.0",
|
|
1127
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz",
|
|
1128
|
+
"integrity": "sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==",
|
|
1129
1129
|
"cpu": [
|
|
1130
1130
|
"x64"
|
|
1131
1131
|
],
|
|
@@ -1135,9 +1135,9 @@
|
|
|
1135
1135
|
]
|
|
1136
1136
|
},
|
|
1137
1137
|
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
|
1138
|
-
"version": "4.
|
|
1139
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.
|
|
1140
|
-
"integrity": "sha512-
|
|
1138
|
+
"version": "4.21.0",
|
|
1139
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz",
|
|
1140
|
+
"integrity": "sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==",
|
|
1141
1141
|
"cpu": [
|
|
1142
1142
|
"arm64"
|
|
1143
1143
|
],
|
|
@@ -1147,9 +1147,9 @@
|
|
|
1147
1147
|
]
|
|
1148
1148
|
},
|
|
1149
1149
|
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
|
1150
|
-
"version": "4.
|
|
1151
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.
|
|
1152
|
-
"integrity": "sha512-
|
|
1150
|
+
"version": "4.21.0",
|
|
1151
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz",
|
|
1152
|
+
"integrity": "sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==",
|
|
1153
1153
|
"cpu": [
|
|
1154
1154
|
"ia32"
|
|
1155
1155
|
],
|
|
@@ -1159,9 +1159,9 @@
|
|
|
1159
1159
|
]
|
|
1160
1160
|
},
|
|
1161
1161
|
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
|
1162
|
-
"version": "4.
|
|
1163
|
-
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.
|
|
1164
|
-
"integrity": "sha512-
|
|
1162
|
+
"version": "4.21.0",
|
|
1163
|
+
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz",
|
|
1164
|
+
"integrity": "sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==",
|
|
1165
1165
|
"cpu": [
|
|
1166
1166
|
"x64"
|
|
1167
1167
|
],
|
|
@@ -1726,12 +1726,12 @@
|
|
|
1726
1726
|
}
|
|
1727
1727
|
},
|
|
1728
1728
|
"node_modules/chemicaljs": {
|
|
1729
|
-
"version": "1.6.
|
|
1730
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.
|
|
1731
|
-
"integrity": "sha512-
|
|
1729
|
+
"version": "1.6.7",
|
|
1730
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.6.7.tgz",
|
|
1731
|
+
"integrity": "sha512-3BaUpDAaHRD4GiE3MVfJ1cB0lxWx4cojOs/XN3SePmfm96DGjjvWEEpSikoC97yJe2XrNi7JLtASTB1Dk4af9g==",
|
|
1732
1732
|
"dependencies": {
|
|
1733
1733
|
"@mercuryworkshop/bare-mux": "^2.0.4",
|
|
1734
|
-
"@mercuryworkshop/epoxy-transport": "^2.1.
|
|
1734
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.8",
|
|
1735
1735
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
|
1736
1736
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1737
1737
|
"@mercuryworkshop/wisp-js": "^0.1.1",
|
|
@@ -3583,9 +3583,9 @@
|
|
|
3583
3583
|
}
|
|
3584
3584
|
},
|
|
3585
3585
|
"node_modules/postcss": {
|
|
3586
|
-
"version": "8.4.
|
|
3587
|
-
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.
|
|
3588
|
-
"integrity": "sha512-
|
|
3586
|
+
"version": "8.4.41",
|
|
3587
|
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz",
|
|
3588
|
+
"integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==",
|
|
3589
3589
|
"dev": true,
|
|
3590
3590
|
"funding": [
|
|
3591
3591
|
{
|
|
@@ -3611,9 +3611,9 @@
|
|
|
3611
3611
|
}
|
|
3612
3612
|
},
|
|
3613
3613
|
"node_modules/preact": {
|
|
3614
|
-
"version": "10.23.
|
|
3615
|
-
"resolved": "https://registry.npmjs.org/preact/-/preact-10.23.
|
|
3616
|
-
"integrity": "sha512-
|
|
3614
|
+
"version": "10.23.2",
|
|
3615
|
+
"resolved": "https://registry.npmjs.org/preact/-/preact-10.23.2.tgz",
|
|
3616
|
+
"integrity": "sha512-kKYfePf9rzKnxOAKDpsWhg/ysrHPqT+yQ7UW4JjdnqjFIeNUnNcEJvhuA8fDenxAGWzUqtd51DfVg7xp/8T9NA==",
|
|
3617
3617
|
"funding": {
|
|
3618
3618
|
"type": "opencollective",
|
|
3619
3619
|
"url": "https://opencollective.com/preact"
|
|
@@ -3843,9 +3843,9 @@
|
|
|
3843
3843
|
}
|
|
3844
3844
|
},
|
|
3845
3845
|
"node_modules/rollup": {
|
|
3846
|
-
"version": "4.
|
|
3847
|
-
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.
|
|
3848
|
-
"integrity": "sha512-
|
|
3846
|
+
"version": "4.21.0",
|
|
3847
|
+
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.0.tgz",
|
|
3848
|
+
"integrity": "sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==",
|
|
3849
3849
|
"dependencies": {
|
|
3850
3850
|
"@types/estree": "1.0.5"
|
|
3851
3851
|
},
|
|
@@ -3857,22 +3857,22 @@
|
|
|
3857
3857
|
"npm": ">=8.0.0"
|
|
3858
3858
|
},
|
|
3859
3859
|
"optionalDependencies": {
|
|
3860
|
-
"@rollup/rollup-android-arm-eabi": "4.
|
|
3861
|
-
"@rollup/rollup-android-arm64": "4.
|
|
3862
|
-
"@rollup/rollup-darwin-arm64": "4.
|
|
3863
|
-
"@rollup/rollup-darwin-x64": "4.
|
|
3864
|
-
"@rollup/rollup-linux-arm-gnueabihf": "4.
|
|
3865
|
-
"@rollup/rollup-linux-arm-musleabihf": "4.
|
|
3866
|
-
"@rollup/rollup-linux-arm64-gnu": "4.
|
|
3867
|
-
"@rollup/rollup-linux-arm64-musl": "4.
|
|
3868
|
-
"@rollup/rollup-linux-powerpc64le-gnu": "4.
|
|
3869
|
-
"@rollup/rollup-linux-riscv64-gnu": "4.
|
|
3870
|
-
"@rollup/rollup-linux-s390x-gnu": "4.
|
|
3871
|
-
"@rollup/rollup-linux-x64-gnu": "4.
|
|
3872
|
-
"@rollup/rollup-linux-x64-musl": "4.
|
|
3873
|
-
"@rollup/rollup-win32-arm64-msvc": "4.
|
|
3874
|
-
"@rollup/rollup-win32-ia32-msvc": "4.
|
|
3875
|
-
"@rollup/rollup-win32-x64-msvc": "4.
|
|
3860
|
+
"@rollup/rollup-android-arm-eabi": "4.21.0",
|
|
3861
|
+
"@rollup/rollup-android-arm64": "4.21.0",
|
|
3862
|
+
"@rollup/rollup-darwin-arm64": "4.21.0",
|
|
3863
|
+
"@rollup/rollup-darwin-x64": "4.21.0",
|
|
3864
|
+
"@rollup/rollup-linux-arm-gnueabihf": "4.21.0",
|
|
3865
|
+
"@rollup/rollup-linux-arm-musleabihf": "4.21.0",
|
|
3866
|
+
"@rollup/rollup-linux-arm64-gnu": "4.21.0",
|
|
3867
|
+
"@rollup/rollup-linux-arm64-musl": "4.21.0",
|
|
3868
|
+
"@rollup/rollup-linux-powerpc64le-gnu": "4.21.0",
|
|
3869
|
+
"@rollup/rollup-linux-riscv64-gnu": "4.21.0",
|
|
3870
|
+
"@rollup/rollup-linux-s390x-gnu": "4.21.0",
|
|
3871
|
+
"@rollup/rollup-linux-x64-gnu": "4.21.0",
|
|
3872
|
+
"@rollup/rollup-linux-x64-musl": "4.21.0",
|
|
3873
|
+
"@rollup/rollup-win32-arm64-msvc": "4.21.0",
|
|
3874
|
+
"@rollup/rollup-win32-ia32-msvc": "4.21.0",
|
|
3875
|
+
"@rollup/rollup-win32-x64-msvc": "4.21.0",
|
|
3876
3876
|
"fsevents": "~2.3.2"
|
|
3877
3877
|
}
|
|
3878
3878
|
},
|
|
@@ -4709,14 +4709,14 @@
|
|
|
4709
4709
|
}
|
|
4710
4710
|
},
|
|
4711
4711
|
"node_modules/vite": {
|
|
4712
|
-
"version": "5.
|
|
4713
|
-
"resolved": "https://registry.npmjs.org/vite/-/vite-5.
|
|
4714
|
-
"integrity": "sha512-
|
|
4712
|
+
"version": "5.4.2",
|
|
4713
|
+
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.2.tgz",
|
|
4714
|
+
"integrity": "sha512-dDrQTRHp5C1fTFzcSaMxjk6vdpKvT+2/mIdE07Gw2ykehT49O0z/VHS3zZ8iV/Gh8BJJKHWOe5RjaNrW5xf/GA==",
|
|
4715
4715
|
"dev": true,
|
|
4716
4716
|
"dependencies": {
|
|
4717
4717
|
"esbuild": "^0.21.3",
|
|
4718
|
-
"postcss": "^8.4.
|
|
4719
|
-
"rollup": "^4.
|
|
4718
|
+
"postcss": "^8.4.41",
|
|
4719
|
+
"rollup": "^4.20.0"
|
|
4720
4720
|
},
|
|
4721
4721
|
"bin": {
|
|
4722
4722
|
"vite": "bin/vite.js"
|
|
@@ -4735,6 +4735,7 @@
|
|
|
4735
4735
|
"less": "*",
|
|
4736
4736
|
"lightningcss": "^1.21.0",
|
|
4737
4737
|
"sass": "*",
|
|
4738
|
+
"sass-embedded": "*",
|
|
4738
4739
|
"stylus": "*",
|
|
4739
4740
|
"sugarss": "*",
|
|
4740
4741
|
"terser": "^5.4.0"
|
|
@@ -4752,6 +4753,9 @@
|
|
|
4752
4753
|
"sass": {
|
|
4753
4754
|
"optional": true
|
|
4754
4755
|
},
|
|
4756
|
+
"sass-embedded": {
|
|
4757
|
+
"optional": true
|
|
4758
|
+
},
|
|
4755
4759
|
"stylus": {
|
|
4756
4760
|
"optional": true
|
|
4757
4761
|
},
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"build": "vite build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"chemicaljs": "^1.6.
|
|
11
|
+
"chemicaljs": "^1.6.7",
|
|
12
12
|
"express": "^4.19.2",
|
|
13
|
-
"preact": "^10.23.
|
|
13
|
+
"preact": "^10.23.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@preact/preset-vite": "^2.9.0",
|
|
17
|
-
"vite": "^5.
|
|
17
|
+
"vite": "^5.4.2"
|
|
18
18
|
}
|
|
19
19
|
}
|
package/index.js
CHANGED
|
@@ -39,25 +39,13 @@ class ChemicalServer {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
this.options = options;
|
|
42
|
-
|
|
42
|
+
this.server = createServer();
|
|
43
43
|
this.app = express();
|
|
44
|
-
this.
|
|
45
|
-
this.get = this.app.get.bind(this.app);
|
|
46
|
-
this.errorFunctions = [];
|
|
47
|
-
|
|
48
|
-
this.error = (newErrorFunction) => {
|
|
49
|
-
if (newErrorFunction) {
|
|
50
|
-
if (typeof newErrorFunction == "function") {
|
|
51
|
-
this.errorFunctions.push(newErrorFunction);
|
|
52
|
-
} else {
|
|
53
|
-
console.error("Error: Invalid type for Chemical error function.")
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
listen(port, callback) {
|
|
59
|
-
const server = createServer();
|
|
44
|
+
this.app.serveChemical = this.serveChemical;
|
|
60
45
|
|
|
46
|
+
return [this.app, this.listen]
|
|
47
|
+
}
|
|
48
|
+
serveChemical = () => {
|
|
61
49
|
const rh = createRammerhead()
|
|
62
50
|
|
|
63
51
|
const rammerheadScopes = [
|
|
@@ -138,14 +126,14 @@ class ChemicalServer {
|
|
|
138
126
|
this.app.use("/scramjet/", express.static(resolve(__dirname, "config/scramjet")));
|
|
139
127
|
this.app.use("/scramjet/", express.static(scramjetPath));
|
|
140
128
|
}
|
|
141
|
-
server.on("request", (req, res) => {
|
|
129
|
+
this.server.on("request", (req, res) => {
|
|
142
130
|
if (this.options.rammerhead && shouldRouteRh(req)) {
|
|
143
131
|
routeRhRequest(req, res);
|
|
144
132
|
} else {
|
|
145
133
|
this.app(req, res);
|
|
146
134
|
}
|
|
147
135
|
});
|
|
148
|
-
server.on("upgrade", (req, socket, head) => {
|
|
136
|
+
this.server.on("upgrade", (req, socket, head) => {
|
|
149
137
|
if (req.url && req.url.endsWith("/wisp/")) {
|
|
150
138
|
if (this.options.hostname_blacklist) {
|
|
151
139
|
wisp.this.options.hostname_blacklist = this.options.hostname_blacklist
|
|
@@ -160,16 +148,9 @@ class ChemicalServer {
|
|
|
160
148
|
socket.end();
|
|
161
149
|
}
|
|
162
150
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
for (let errorFunction of this.errorFunctions) {
|
|
167
|
-
errorFunction(req, res);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
server.listen(port, callback)
|
|
151
|
+
}
|
|
152
|
+
listen = (port, callback) => {
|
|
153
|
+
this.server.listen(port, callback)
|
|
173
154
|
}
|
|
174
155
|
}
|
|
175
156
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chemicaljs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Easily create your own web proxy with no experience required.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "AGPL-3.0-only",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@mercuryworkshop/bare-mux": "^2.0.4",
|
|
15
|
-
"@mercuryworkshop/epoxy-transport": "^2.1.
|
|
15
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.8",
|
|
16
16
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
|
17
17
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
18
18
|
"@mercuryworkshop/wisp-js": "^0.1.1",
|