bump to 1.0.1, log new sw.js format
This commit is contained in:
parent
0bff4aacd2
commit
78c838bd9f
4 changed files with 38 additions and 3 deletions
33
CHANGELOG.md
Normal file
33
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# v1.0.1
|
||||||
|
|
||||||
|
In your `sw.js` script, you MUST import `uv.bundle.js` then `uv.config.js` in order. This is because we can no longer hard-code the paths. Ideally, we would import `uv.config.js` then use the config.bundle path in the serviceworker, however the config is dependant on `uv.bundle.js`, which we don't know the location to.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
```js
|
||||||
|
importScripts('./uv/uv.sw.js');
|
||||||
|
|
||||||
|
const sw = new UVServiceWorker();
|
||||||
|
|
||||||
|
self.addEventListener('fetch', event =>
|
||||||
|
event.respondWith(
|
||||||
|
sw.fetch(event)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
New:
|
||||||
|
```diff
|
||||||
|
+ importScripts('./uv/uv.bundle.js');
|
||||||
|
+ importScripts('./uv/uv.config.js');
|
||||||
|
importScripts('./uv/uv.sw.js');
|
||||||
|
|
||||||
|
const sw = new UVServiceWorker();
|
||||||
|
|
||||||
|
self.addEventListener('fetch', event =>
|
||||||
|
event.respondWith(
|
||||||
|
sw.fetch(event)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
You are still required to specify all paths in `uv.config.js`.
|
||||||
|
|
@ -6,6 +6,8 @@ Advanced web proxy used for evading internet censorship or accessing websites in
|
||||||
|
|
||||||
Ultraviolet works by intercepting HTTP requests with a service worker script that follows the [TompHTTP specifications](https://github.com/tomphttp).
|
Ultraviolet works by intercepting HTTP requests with a service worker script that follows the [TompHTTP specifications](https://github.com/tomphttp).
|
||||||
|
|
||||||
|
See the [changelog](./CHANGELOG.md).
|
||||||
|
|
||||||
## How do I deploy/run this?
|
## How do I deploy/run this?
|
||||||
|
|
||||||
This repository is the bare-bones of Ultraviolet. This only contains the source code required to compile `uv.bundle.js`.
|
This repository is the bare-bones of Ultraviolet. This only contains the source code required to compile `uv.bundle.js`.
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "ultraviolet",
|
"name": "ultraviolet",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ultraviolet",
|
"name": "ultraviolet",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bowser": "^2.11.0",
|
"bowser": "^2.11.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ultraviolet",
|
"name": "ultraviolet",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Proxy",
|
"description": "Proxy",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue