Skip to content

Commit

Permalink
bump to 1.0.1, log new sw.js format
Browse files Browse the repository at this point in the history
  • Loading branch information
e9x committed Sep 15, 2022
1 parent 0bff4aa commit 78c838b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ultraviolet",
"version": "1.0.0",
"version": "1.0.1",
"description": "Proxy",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 78c838b

Please sign in to comment.