chemicaljs 1.4.5 → 1.4.7
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 +8 -4
- package/examples/example/index.js +1 -1
- package/examples/example/package-lock.json +18 -17
- package/examples/example/package.json +1 -1
- package/examples/example-components/package-lock.json +18 -17
- package/examples/example-components/package.json +1 -1
- package/examples/example-styled/package-lock.json +18 -17
- package/examples/example-styled/package.json +1 -1
- package/examples/example-vite/package-lock.json +18 -17
- package/examples/example-vite/package.json +1 -1
- package/index.js +14 -0
- package/package.json +1 -1
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
|
|
|
@@ -82,7 +84,7 @@ In your project create a folder to store your static assets. Create an index.htm
|
|
|
82
84
|
If you want to set the wisp server to an external server just change the `wisp` attribute.
|
|
83
85
|
|
|
84
86
|
```html
|
|
85
|
-
<script wisp="wss://wisp.mercurywork.shop" src="/chemical.js"></script>
|
|
87
|
+
<script wisp="wss://wisp.mercurywork.shop/" src="/chemical.js"></script>
|
|
86
88
|
```
|
|
87
89
|
|
|
88
90
|
If you want to set the transport just change the `transport` attribute. Choose `libcurl` (default becuase it supports Firefox) or `epoxy`.
|
|
@@ -120,7 +122,7 @@ window.addEventListener("chemicalLoaded", function(e) {
|
|
|
120
122
|
4. Change the transport and Wisp URL with `chemicalTransport`
|
|
121
123
|
|
|
122
124
|
```js
|
|
123
|
-
await chemicalTransport("libcurl", "wss://wisp.mercurywork.shop")
|
|
125
|
+
await chemicalTransport("libcurl", "wss://wisp.mercurywork.shop/")
|
|
124
126
|
```
|
|
125
127
|
|
|
126
128
|
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.
|
|
@@ -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
|
})
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.4.
|
|
12
|
+
"chemicaljs": "^1.4.6",
|
|
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.
|
|
1162
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1163
|
-
"integrity": "sha512-
|
|
1170
|
+
"version": "1.4.6",
|
|
1171
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.6.tgz",
|
|
1172
|
+
"integrity": "sha512-GxE/Z2GjklXH16cU5pXCf/fAndiVGdy+FlLT27YUk4fxZwb2W/fD9+O3sC4e9oeCT2CJ3y1g/vkQ0y0Yr4I/Ow==",
|
|
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
|
-
"@
|
|
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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.4.
|
|
12
|
+
"chemicaljs": "^1.4.6",
|
|
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.
|
|
1162
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1163
|
-
"integrity": "sha512-
|
|
1170
|
+
"version": "1.4.6",
|
|
1171
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.6.tgz",
|
|
1172
|
+
"integrity": "sha512-GxE/Z2GjklXH16cU5pXCf/fAndiVGdy+FlLT27YUk4fxZwb2W/fD9+O3sC4e9oeCT2CJ3y1g/vkQ0y0Yr4I/Ow==",
|
|
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
|
-
"@
|
|
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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.4.
|
|
12
|
+
"chemicaljs": "^1.4.6",
|
|
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.
|
|
1162
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1163
|
-
"integrity": "sha512-
|
|
1170
|
+
"version": "1.4.6",
|
|
1171
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.6.tgz",
|
|
1172
|
+
"integrity": "sha512-GxE/Z2GjklXH16cU5pXCf/fAndiVGdy+FlLT27YUk4fxZwb2W/fD9+O3sC4e9oeCT2CJ3y1g/vkQ0y0Yr4I/Ow==",
|
|
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
|
-
"@
|
|
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",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"": {
|
|
7
7
|
"name": "chemical-example-vite",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"chemicaljs": "^1.4.
|
|
9
|
+
"chemicaljs": "^1.4.6",
|
|
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.
|
|
1725
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1726
|
-
"integrity": "sha512-
|
|
1733
|
+
"version": "1.4.6",
|
|
1734
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.6.tgz",
|
|
1735
|
+
"integrity": "sha512-GxE/Z2GjklXH16cU5pXCf/fAndiVGdy+FlLT27YUk4fxZwb2W/fD9+O3sC4e9oeCT2CJ3y1g/vkQ0y0Yr4I/Ow==",
|
|
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
|
-
"@
|
|
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",
|
package/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import createRammerhead from "rammerhead/src/server/index.js";
|
|
|
13
13
|
|
|
14
14
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
15
|
|
|
16
|
+
logging.set_level(logging.ERROR)
|
|
17
|
+
|
|
16
18
|
class ChemicalServer {
|
|
17
19
|
constructor(options) {
|
|
18
20
|
if (options) {
|
|
@@ -127,6 +129,12 @@ class ChemicalServer {
|
|
|
127
129
|
});
|
|
128
130
|
this.server.on("upgrade", (req, socket, head) => {
|
|
129
131
|
if (req.url && req.url.endsWith("/wisp/")) {
|
|
132
|
+
if (options.hostname_blacklist) {
|
|
133
|
+
wisp.options.hostname_blacklist = options.hostname_blacklist
|
|
134
|
+
}
|
|
135
|
+
if (options.hostname_whitelist) {
|
|
136
|
+
wisp.options.hostname_whitelist = options.hostname_whitelist
|
|
137
|
+
}
|
|
130
138
|
wisp.routeRequest(req, socket, head);
|
|
131
139
|
} else if (options.rammerhead && shouldRouteRh(req)) {
|
|
132
140
|
routeRhUpgrade(req, socket, head);
|
|
@@ -261,6 +269,12 @@ const ChemicalVitePlugin = (options) => ({
|
|
|
261
269
|
|
|
262
270
|
server.httpServer.on("upgrade", (req, socket, head) => {
|
|
263
271
|
if (req.url && req.url.endsWith("/wisp/")) {
|
|
272
|
+
if (options.hostname_blacklist) {
|
|
273
|
+
wisp.options.hostname_blacklist = options.hostname_blacklist
|
|
274
|
+
}
|
|
275
|
+
if (options.hostname_whitelist) {
|
|
276
|
+
wisp.options.hostname_whitelist = options.hostname_whitelist
|
|
277
|
+
}
|
|
264
278
|
wisp.routeRequest(req, socket, head)
|
|
265
279
|
} else if (options.rammerhead && shouldRouteRh(req)) {
|
|
266
280
|
routeRhUpgrade(req, socket, head)
|