chemicaljs 1.4.5 → 1.4.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/README.md CHANGED
@@ -32,7 +32,9 @@ const chemical = new ChemicalServer({
32
32
  default: "rammerhead",
33
33
  uv: true,
34
34
  scramjet: false,
35
- rammerhead: true
35
+ rammerhead: true,
36
+ hostname_blacklist: [ /google\.com/, /reddit\.com/ ],
37
+ hostname_whitelist: [ /example\.com/ ]
36
38
  });
37
39
  ```
38
40
 
@@ -165,7 +167,9 @@ export default defineConfig({
165
167
  default: "rammerhead",
166
168
  uv: true,
167
169
  scramjet: false,
168
- rammerhead: true
170
+ rammerhead: true,
171
+ hostname_blacklist: [ /google\.com/, /reddit\.com/ ],
172
+ hostname_whitelist: [ /example\.com/ ]
169
173
  })
170
174
  ],
171
175
  })
@@ -1,4 +1,4 @@
1
- import { ChemicalServer } from "../../index.js";
1
+ import { ChemicalServer } from "chemicaljs";
2
2
  import express from "express";
3
3
 
4
4
  const chemical = new ChemicalServer();
@@ -9,7 +9,7 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "chemicaljs": "^1.4.4",
12
+ "chemicaljs": "^1.4.5",
13
13
  "express": "^4.19.2"
14
14
  }
15
15
  },
@@ -475,6 +475,15 @@
475
475
  "uuid": "dist/bin/uuid"
476
476
  }
477
477
  },
478
+ "node_modules/@mercuryworkshop/wisp-js": {
479
+ "version": "0.1.0",
480
+ "resolved": "https://registry.npmjs.org/@mercuryworkshop/wisp-js/-/wisp-js-0.1.0.tgz",
481
+ "integrity": "sha512-KhSViqQmRr7cFKi4zb/VawYikeJlRbICvh6mBEAvGBhK4SAX/3xhhRNgsdw/nVEykU9oBhY7qR2SPxG6Up7jFg==",
482
+ "dependencies": {
483
+ "bufferutil": "^4.0.8",
484
+ "ws": "^8.17.1"
485
+ }
486
+ },
478
487
  "node_modules/@npmcli/fs": {
479
488
  "version": "1.1.1",
480
489
  "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz",
@@ -1158,18 +1167,18 @@
1158
1167
  }
1159
1168
  },
1160
1169
  "node_modules/chemicaljs": {
1161
- "version": "1.4.4",
1162
- "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.4.tgz",
1163
- "integrity": "sha512-zSQpbS5h+1RZgxZ45mIHgBErX3q3A8PfNhaaoWfShO+nNBVoFHLyAsL6k1ETvP+7cxwMbt/m/9D723099g4ABQ==",
1170
+ "version": "1.4.5",
1171
+ "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.5.tgz",
1172
+ "integrity": "sha512-QfSAhF6Mv/84cWSm09HJrSDVQTHAxVYo5NmNzx4jauDqZtLogqgftKbhws2nP0g1PH0ZQ2wmesWbiE5EcxuUNw==",
1164
1173
  "dependencies": {
1165
1174
  "@mercuryworkshop/bare-mux": "^2.0.2",
1166
1175
  "@mercuryworkshop/epoxy-transport": "^2.1.3",
1167
1176
  "@mercuryworkshop/libcurl-transport": "^1.3.6",
1168
1177
  "@mercuryworkshop/scramjet": "^1.0.2",
1169
- "@titaniumnetwork-dev/ultraviolet": "^3.2.3",
1178
+ "@mercuryworkshop/wisp-js": "^0.1.0",
1179
+ "@titaniumnetwork-dev/ultraviolet": "^3.2.2",
1170
1180
  "express": "^4.19.2",
1171
- "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz",
1172
- "wisp-server-node": "^1.1.0"
1181
+ "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
1173
1182
  }
1174
1183
  },
1175
1184
  "node_modules/chownr": {
@@ -3780,6 +3789,8 @@
3780
3789
  "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.4.tgz",
3781
3790
  "integrity": "sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ==",
3782
3791
  "hasInstallScript": true,
3792
+ "optional": true,
3793
+ "peer": true,
3783
3794
  "dependencies": {
3784
3795
  "node-gyp-build": "^4.3.0"
3785
3796
  },
@@ -3848,16 +3859,6 @@
3848
3859
  "string-width": "^1.0.2 || 2 || 3 || 4"
3849
3860
  }
3850
3861
  },
3851
- "node_modules/wisp-server-node": {
3852
- "version": "1.1.0",
3853
- "resolved": "https://registry.npmjs.org/wisp-server-node/-/wisp-server-node-1.1.0.tgz",
3854
- "integrity": "sha512-kJcuDIZZfV/HOkTepoVLfwzP7IieE0GfU57UTe8z2IwNRp+YbL12q5xsImcMNEYb9QeP/8loXiyBKXdZ+vojow==",
3855
- "dependencies": {
3856
- "bufferutil": "^4.0.8",
3857
- "utf-8-validate": "^6.0.3",
3858
- "ws": "^8.16.0"
3859
- }
3860
- },
3861
3862
  "node_modules/wrappy": {
3862
3863
  "version": "1.0.2",
3863
3864
  "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/chemicaljs/chemical#readme",
20
20
  "dependencies": {
21
- "chemicaljs": "^1.4.4",
21
+ "chemicaljs": "^1.4.5",
22
22
  "express": "^4.19.2"
23
23
  }
24
24
  }
@@ -9,7 +9,7 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "chemicaljs": "^1.4.4",
12
+ "chemicaljs": "^1.4.5",
13
13
  "express": "^4.19.2"
14
14
  }
15
15
  },
@@ -475,6 +475,15 @@
475
475
  "uuid": "dist/bin/uuid"
476
476
  }
477
477
  },
478
+ "node_modules/@mercuryworkshop/wisp-js": {
479
+ "version": "0.1.0",
480
+ "resolved": "https://registry.npmjs.org/@mercuryworkshop/wisp-js/-/wisp-js-0.1.0.tgz",
481
+ "integrity": "sha512-KhSViqQmRr7cFKi4zb/VawYikeJlRbICvh6mBEAvGBhK4SAX/3xhhRNgsdw/nVEykU9oBhY7qR2SPxG6Up7jFg==",
482
+ "dependencies": {
483
+ "bufferutil": "^4.0.8",
484
+ "ws": "^8.17.1"
485
+ }
486
+ },
478
487
  "node_modules/@npmcli/fs": {
479
488
  "version": "1.1.1",
480
489
  "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz",
@@ -1158,18 +1167,18 @@
1158
1167
  }
1159
1168
  },
1160
1169
  "node_modules/chemicaljs": {
1161
- "version": "1.4.4",
1162
- "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.4.tgz",
1163
- "integrity": "sha512-zSQpbS5h+1RZgxZ45mIHgBErX3q3A8PfNhaaoWfShO+nNBVoFHLyAsL6k1ETvP+7cxwMbt/m/9D723099g4ABQ==",
1170
+ "version": "1.4.5",
1171
+ "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.5.tgz",
1172
+ "integrity": "sha512-QfSAhF6Mv/84cWSm09HJrSDVQTHAxVYo5NmNzx4jauDqZtLogqgftKbhws2nP0g1PH0ZQ2wmesWbiE5EcxuUNw==",
1164
1173
  "dependencies": {
1165
1174
  "@mercuryworkshop/bare-mux": "^2.0.2",
1166
1175
  "@mercuryworkshop/epoxy-transport": "^2.1.3",
1167
1176
  "@mercuryworkshop/libcurl-transport": "^1.3.6",
1168
1177
  "@mercuryworkshop/scramjet": "^1.0.2",
1169
- "@titaniumnetwork-dev/ultraviolet": "^3.2.3",
1178
+ "@mercuryworkshop/wisp-js": "^0.1.0",
1179
+ "@titaniumnetwork-dev/ultraviolet": "^3.2.2",
1170
1180
  "express": "^4.19.2",
1171
- "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz",
1172
- "wisp-server-node": "^1.1.0"
1181
+ "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
1173
1182
  }
1174
1183
  },
1175
1184
  "node_modules/chownr": {
@@ -3780,6 +3789,8 @@
3780
3789
  "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.4.tgz",
3781
3790
  "integrity": "sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ==",
3782
3791
  "hasInstallScript": true,
3792
+ "optional": true,
3793
+ "peer": true,
3783
3794
  "dependencies": {
3784
3795
  "node-gyp-build": "^4.3.0"
3785
3796
  },
@@ -3848,16 +3859,6 @@
3848
3859
  "string-width": "^1.0.2 || 2 || 3 || 4"
3849
3860
  }
3850
3861
  },
3851
- "node_modules/wisp-server-node": {
3852
- "version": "1.1.0",
3853
- "resolved": "https://registry.npmjs.org/wisp-server-node/-/wisp-server-node-1.1.0.tgz",
3854
- "integrity": "sha512-kJcuDIZZfV/HOkTepoVLfwzP7IieE0GfU57UTe8z2IwNRp+YbL12q5xsImcMNEYb9QeP/8loXiyBKXdZ+vojow==",
3855
- "dependencies": {
3856
- "bufferutil": "^4.0.8",
3857
- "utf-8-validate": "^6.0.3",
3858
- "ws": "^8.16.0"
3859
- }
3860
- },
3861
3862
  "node_modules/wrappy": {
3862
3863
  "version": "1.0.2",
3863
3864
  "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/chemicaljs/chemical#readme",
20
20
  "dependencies": {
21
- "chemicaljs": "^1.4.4",
21
+ "chemicaljs": "^1.4.5",
22
22
  "express": "^4.19.2"
23
23
  }
24
24
  }
@@ -9,7 +9,7 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "chemicaljs": "^1.4.4",
12
+ "chemicaljs": "^1.4.5",
13
13
  "express": "^4.19.2"
14
14
  }
15
15
  },
@@ -475,6 +475,15 @@
475
475
  "uuid": "dist/bin/uuid"
476
476
  }
477
477
  },
478
+ "node_modules/@mercuryworkshop/wisp-js": {
479
+ "version": "0.1.0",
480
+ "resolved": "https://registry.npmjs.org/@mercuryworkshop/wisp-js/-/wisp-js-0.1.0.tgz",
481
+ "integrity": "sha512-KhSViqQmRr7cFKi4zb/VawYikeJlRbICvh6mBEAvGBhK4SAX/3xhhRNgsdw/nVEykU9oBhY7qR2SPxG6Up7jFg==",
482
+ "dependencies": {
483
+ "bufferutil": "^4.0.8",
484
+ "ws": "^8.17.1"
485
+ }
486
+ },
478
487
  "node_modules/@npmcli/fs": {
479
488
  "version": "1.1.1",
480
489
  "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz",
@@ -1158,18 +1167,18 @@
1158
1167
  }
1159
1168
  },
1160
1169
  "node_modules/chemicaljs": {
1161
- "version": "1.4.4",
1162
- "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.4.tgz",
1163
- "integrity": "sha512-zSQpbS5h+1RZgxZ45mIHgBErX3q3A8PfNhaaoWfShO+nNBVoFHLyAsL6k1ETvP+7cxwMbt/m/9D723099g4ABQ==",
1170
+ "version": "1.4.5",
1171
+ "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.5.tgz",
1172
+ "integrity": "sha512-QfSAhF6Mv/84cWSm09HJrSDVQTHAxVYo5NmNzx4jauDqZtLogqgftKbhws2nP0g1PH0ZQ2wmesWbiE5EcxuUNw==",
1164
1173
  "dependencies": {
1165
1174
  "@mercuryworkshop/bare-mux": "^2.0.2",
1166
1175
  "@mercuryworkshop/epoxy-transport": "^2.1.3",
1167
1176
  "@mercuryworkshop/libcurl-transport": "^1.3.6",
1168
1177
  "@mercuryworkshop/scramjet": "^1.0.2",
1169
- "@titaniumnetwork-dev/ultraviolet": "^3.2.3",
1178
+ "@mercuryworkshop/wisp-js": "^0.1.0",
1179
+ "@titaniumnetwork-dev/ultraviolet": "^3.2.2",
1170
1180
  "express": "^4.19.2",
1171
- "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz",
1172
- "wisp-server-node": "^1.1.0"
1181
+ "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
1173
1182
  }
1174
1183
  },
1175
1184
  "node_modules/chownr": {
@@ -3780,6 +3789,8 @@
3780
3789
  "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.4.tgz",
3781
3790
  "integrity": "sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ==",
3782
3791
  "hasInstallScript": true,
3792
+ "optional": true,
3793
+ "peer": true,
3783
3794
  "dependencies": {
3784
3795
  "node-gyp-build": "^4.3.0"
3785
3796
  },
@@ -3848,16 +3859,6 @@
3848
3859
  "string-width": "^1.0.2 || 2 || 3 || 4"
3849
3860
  }
3850
3861
  },
3851
- "node_modules/wisp-server-node": {
3852
- "version": "1.1.0",
3853
- "resolved": "https://registry.npmjs.org/wisp-server-node/-/wisp-server-node-1.1.0.tgz",
3854
- "integrity": "sha512-kJcuDIZZfV/HOkTepoVLfwzP7IieE0GfU57UTe8z2IwNRp+YbL12q5xsImcMNEYb9QeP/8loXiyBKXdZ+vojow==",
3855
- "dependencies": {
3856
- "bufferutil": "^4.0.8",
3857
- "utf-8-validate": "^6.0.3",
3858
- "ws": "^8.16.0"
3859
- }
3860
- },
3861
3862
  "node_modules/wrappy": {
3862
3863
  "version": "1.0.2",
3863
3864
  "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/chemicaljs/chemical#readme",
20
20
  "dependencies": {
21
- "chemicaljs": "^1.4.4",
21
+ "chemicaljs": "^1.4.5",
22
22
  "express": "^4.19.2"
23
23
  }
24
24
  }
@@ -6,7 +6,7 @@
6
6
  "": {
7
7
  "name": "chemical-example-vite",
8
8
  "dependencies": {
9
- "chemicaljs": "^1.4.4",
9
+ "chemicaljs": "^1.4.5",
10
10
  "express": "^4.19.2",
11
11
  "preact": "^10.22.1"
12
12
  },
@@ -862,6 +862,15 @@
862
862
  "uuid": "dist/bin/uuid"
863
863
  }
864
864
  },
865
+ "node_modules/@mercuryworkshop/wisp-js": {
866
+ "version": "0.1.0",
867
+ "resolved": "https://registry.npmjs.org/@mercuryworkshop/wisp-js/-/wisp-js-0.1.0.tgz",
868
+ "integrity": "sha512-KhSViqQmRr7cFKi4zb/VawYikeJlRbICvh6mBEAvGBhK4SAX/3xhhRNgsdw/nVEykU9oBhY7qR2SPxG6Up7jFg==",
869
+ "dependencies": {
870
+ "bufferutil": "^4.0.8",
871
+ "ws": "^8.17.1"
872
+ }
873
+ },
865
874
  "node_modules/@npmcli/fs": {
866
875
  "version": "1.1.1",
867
876
  "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz",
@@ -1721,18 +1730,18 @@
1721
1730
  }
1722
1731
  },
1723
1732
  "node_modules/chemicaljs": {
1724
- "version": "1.4.4",
1725
- "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.4.tgz",
1726
- "integrity": "sha512-zSQpbS5h+1RZgxZ45mIHgBErX3q3A8PfNhaaoWfShO+nNBVoFHLyAsL6k1ETvP+7cxwMbt/m/9D723099g4ABQ==",
1733
+ "version": "1.4.5",
1734
+ "resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.5.tgz",
1735
+ "integrity": "sha512-QfSAhF6Mv/84cWSm09HJrSDVQTHAxVYo5NmNzx4jauDqZtLogqgftKbhws2nP0g1PH0ZQ2wmesWbiE5EcxuUNw==",
1727
1736
  "dependencies": {
1728
1737
  "@mercuryworkshop/bare-mux": "^2.0.2",
1729
1738
  "@mercuryworkshop/epoxy-transport": "^2.1.3",
1730
1739
  "@mercuryworkshop/libcurl-transport": "^1.3.6",
1731
1740
  "@mercuryworkshop/scramjet": "^1.0.2",
1732
- "@titaniumnetwork-dev/ultraviolet": "^3.2.3",
1741
+ "@mercuryworkshop/wisp-js": "^0.1.0",
1742
+ "@titaniumnetwork-dev/ultraviolet": "^3.2.2",
1733
1743
  "express": "^4.19.2",
1734
- "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz",
1735
- "wisp-server-node": "^1.1.0"
1744
+ "rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
1736
1745
  }
1737
1746
  },
1738
1747
  "node_modules/chownr": {
@@ -4665,6 +4674,8 @@
4665
4674
  "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.4.tgz",
4666
4675
  "integrity": "sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ==",
4667
4676
  "hasInstallScript": true,
4677
+ "optional": true,
4678
+ "peer": true,
4668
4679
  "dependencies": {
4669
4680
  "node-gyp-build": "^4.3.0"
4670
4681
  },
@@ -4788,16 +4799,6 @@
4788
4799
  "string-width": "^1.0.2 || 2 || 3 || 4"
4789
4800
  }
4790
4801
  },
4791
- "node_modules/wisp-server-node": {
4792
- "version": "1.1.0",
4793
- "resolved": "https://registry.npmjs.org/wisp-server-node/-/wisp-server-node-1.1.0.tgz",
4794
- "integrity": "sha512-kJcuDIZZfV/HOkTepoVLfwzP7IieE0GfU57UTe8z2IwNRp+YbL12q5xsImcMNEYb9QeP/8loXiyBKXdZ+vojow==",
4795
- "dependencies": {
4796
- "bufferutil": "^4.0.8",
4797
- "utf-8-validate": "^6.0.3",
4798
- "ws": "^8.16.0"
4799
- }
4800
- },
4801
4802
  "node_modules/wrappy": {
4802
4803
  "version": "1.0.2",
4803
4804
  "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -8,7 +8,7 @@
8
8
  "build": "vite build"
9
9
  },
10
10
  "dependencies": {
11
- "chemicaljs": "^1.4.4",
11
+ "chemicaljs": "^1.4.5",
12
12
  "express": "^4.19.2",
13
13
  "preact": "^10.22.1"
14
14
  },
package/index.js CHANGED
@@ -127,6 +127,12 @@ class ChemicalServer {
127
127
  });
128
128
  this.server.on("upgrade", (req, socket, head) => {
129
129
  if (req.url && req.url.endsWith("/wisp/")) {
130
+ if (options.hostname_blacklist) {
131
+ wisp.options.hostname_blacklist = options.hostname_blacklist
132
+ }
133
+ if (options.hostname_whitelist) {
134
+ wisp.options.hostname_whitelist = options.hostname_whitelist
135
+ }
130
136
  wisp.routeRequest(req, socket, head);
131
137
  } else if (options.rammerhead && shouldRouteRh(req)) {
132
138
  routeRhUpgrade(req, socket, head);
@@ -261,6 +267,12 @@ const ChemicalVitePlugin = (options) => ({
261
267
 
262
268
  server.httpServer.on("upgrade", (req, socket, head) => {
263
269
  if (req.url && req.url.endsWith("/wisp/")) {
270
+ if (options.hostname_blacklist) {
271
+ wisp.options.hostname_blacklist = options.hostname_blacklist
272
+ }
273
+ if (options.hostname_whitelist) {
274
+ wisp.options.hostname_whitelist = options.hostname_whitelist
275
+ }
264
276
  wisp.routeRequest(req, socket, head)
265
277
  } else if (options.rammerhead && shouldRouteRh(req)) {
266
278
  routeRhUpgrade(req, socket, head)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chemicaljs",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "Easily create your own web proxy with no experience required.",
5
5
  "repository": {
6
6
  "type": "git",