bump to 1.0.1, log new sw.js format

This commit is contained in:
David Reed 2022-09-15 18:08:25 -04:00
parent 0bff4aacd2
commit 78c838bd9f
4 changed files with 38 additions and 3 deletions

33
CHANGELOG.md Normal file
View 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`.

View file

@ -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).
See the [changelog](./CHANGELOG.md).
## 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`.

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "ultraviolet",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ultraviolet",
"version": "1.0.0",
"version": "1.0.1",
"license": "ISC",
"dependencies": {
"bowser": "^2.11.0",

View file

@ -1,6 +1,6 @@
{
"name": "ultraviolet",
"version": "1.0.0",
"version": "1.0.1",
"description": "Proxy",
"main": "lib/index.js",
"scripts": {