@mercuryworkshop/scramjet 1.0.1 → 1.1.0

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.
Files changed (59) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +89 -21
  3. package/dist/scramjet.all.js +196 -0
  4. package/dist/scramjet.all.js.map +1 -0
  5. package/dist/scramjet.bundle.js +196 -7
  6. package/dist/scramjet.bundle.js.map +1 -7
  7. package/dist/scramjet.sync.js +2 -0
  8. package/dist/scramjet.sync.js.map +1 -0
  9. package/dist/scramjet.wasm.wasm +0 -0
  10. package/dist/types/client/client.d.ts +78 -0
  11. package/dist/types/client/entry.d.ts +8 -0
  12. package/dist/types/client/events.d.ts +66 -0
  13. package/dist/types/client/helpers.d.ts +1 -0
  14. package/dist/types/client/index.d.ts +8 -0
  15. package/dist/types/client/location.d.ts +2 -0
  16. package/dist/types/client/shared/eval.d.ts +3 -0
  17. package/dist/types/client/shared/sourcemaps.d.ts +19 -0
  18. package/dist/types/client/shared/wrap.d.ts +4 -0
  19. package/dist/types/client/singletonbox.d.ts +12 -0
  20. package/dist/types/client/swruntime.d.ts +40 -0
  21. package/dist/types/controller/controller.d.ts +16 -0
  22. package/dist/types/controller/frame.d.ts +103 -0
  23. package/dist/types/controller/index.d.ts +2 -0
  24. package/dist/types/entry.d.ts +160 -0
  25. package/dist/types/index.d.ts +8 -0
  26. package/dist/types/shared/cookie.d.ts +18 -0
  27. package/dist/types/shared/headers.d.ts +4 -0
  28. package/dist/types/shared/htmlRules.d.ts +6 -0
  29. package/dist/types/shared/index.d.ts +12 -0
  30. package/dist/types/shared/rewriters/css.d.ts +3 -0
  31. package/dist/types/shared/rewriters/headers.d.ts +18 -0
  32. package/dist/types/shared/rewriters/html.d.ts +6 -0
  33. package/dist/types/shared/rewriters/index.d.ts +7 -0
  34. package/dist/types/shared/rewriters/js.d.ts +10 -0
  35. package/dist/types/shared/rewriters/url.d.ts +10 -0
  36. package/dist/types/shared/rewriters/wasm.d.ts +7 -0
  37. package/dist/types/shared/rewriters/worker.d.ts +2 -0
  38. package/dist/types/shared/security/forceReferrer.d.ts +49 -0
  39. package/dist/types/shared/security/index.d.ts +2 -0
  40. package/dist/types/shared/security/siteTests.d.ts +33 -0
  41. package/dist/types/symbols.d.ts +7 -0
  42. package/dist/types/types.d.ts +135 -0
  43. package/dist/types/worker/error.d.ts +2 -0
  44. package/dist/types/worker/fakesw.d.ts +12 -0
  45. package/dist/types/worker/fetch.d.ts +26 -0
  46. package/dist/types/worker/index.d.ts +143 -0
  47. package/lib/index.cjs +7 -0
  48. package/lib/index.d.ts +8 -3
  49. package/lib/noop.js +0 -0
  50. package/package.json +101 -34
  51. package/dist/scramjet.client.js +0 -1
  52. package/dist/scramjet.client.js.map +0 -7
  53. package/dist/scramjet.codecs.js +0 -3
  54. package/dist/scramjet.codecs.js.map +0 -7
  55. package/dist/scramjet.config.js +0 -1
  56. package/dist/scramjet.config.js.map +0 -7
  57. package/dist/scramjet.worker.js +0 -42
  58. package/dist/scramjet.worker.js.map +0 -7
  59. package/lib/index.js +0 -5
package/LICENSE CHANGED
@@ -630,11 +630,11 @@ state the exclusion of warranty; and each file should have at least
630
630
  the "copyright" line and a pointer to where the full notice is found.
631
631
 
632
632
  <one line to give the program's name and a brief idea of what it does.>
633
- Copyright (C) 2024 <name of author>
633
+ Copyright (C) <year> <name of author>
634
634
 
635
635
  This program is free software: you can redistribute it and/or modify
636
- it under the terms of the GNU Affero General Public License as published
637
- by the Free Software Foundation, either version 3 of the License, or
636
+ it under the terms of the GNU Affero General Public License as published by
637
+ the Free Software Foundation, either version 3 of the License, or
638
638
  (at your option) any later version.
639
639
 
640
640
  This program is distributed in the hope that it will be useful,
package/README.md CHANGED
@@ -1,21 +1,89 @@
1
- # Scramjet
2
-
3
- Scramjet is an experimental web proxy that aims to be the successor to Ultraviolet.
4
-
5
- It currently does not support most websites due to it being very early in the development stage.
6
-
7
- The UI is not finalized and only used as a means to test the web proxy.
8
-
9
- ## How to build
10
- Running `pnpm dev` will build Scramjet and start a dev server on localhost:1337. If you only want to build the proxy without using the dev server, run `pnpm build`.
11
-
12
-
13
-
14
- ## TODO
15
- - Finish HTML rewriting
16
- - `<script type="importmap"></script>` rewriting
17
- - Make an array of all possible import values and pass the array onto the JS rewriter, then rewrite all the URLs inside of it
18
- - Finish JS rewriting
19
- - Only thing rewritten currently are imports and exports
20
- - Check imports/exports for values contained in the `importmap` array, don't rewrite the node value if present
21
- - Write client APIs
1
+ <h1 align="center">Scramjet</h1>
2
+ <div align="center">
3
+ <img src="assets/scramjet.png" height="200" />
4
+ </div>
5
+
6
+ <div align="center">
7
+ <a href="https://www.npmjs.com/package/@mercuryworkshop/scramjet"><img src="https://img.shields.io/npm/v/@mercuryworkshop/scramjet.svg?maxAge=3600" alt="npm version" /></a>
8
+ <img src="https://img.shields.io/github/issues/MercuryWorkshop/scramjet?style=flat&color=orange" />
9
+ <img src="https://img.shields.io/github/stars/MercuryWorkshop/scramjet?style=flat&color=orange" />
10
+ </div>
11
+
12
+ ---
13
+
14
+ Scramjet is an interception-based web proxy designed to bypass arbitrary web browser restrictions, support a wide range of sites, and act as middleware for open-source projects. It prioritizes security, developer friendliness, and performance.
15
+
16
+ ## Supported Sites
17
+
18
+ Scramjet has CAPTCHA support! Some of the popular websites that Scramjet supports include:
19
+
20
+ - [Google](https://google.com)
21
+ - [Twitter](https://twitter.com)
22
+ - [Instagram](https://instagram.com)
23
+ - [Youtube](https://youtube.com)
24
+ - [Spotify](https://spotify.com)
25
+ - [Discord](https://discord.com)
26
+ - [Reddit](https://reddit.com)
27
+ - [GeForce NOW](https://play.geforcenow.com/)
28
+
29
+ Ensure you are not hosting on a datacenter IP for CAPTCHAs to work reliably along with YouTube. Heavy amounts of traffic will make some sites NOT work on a single IP. Consider rotating IPs or routing through Wireguard using a project like <a href="https://github.com/whyvl/wireproxy">wireproxy</a>.
30
+
31
+ An easy to deploy version of Scramjet can be found at [Scramjet-App](https://github.com/MercuryWorkshop/scramjet-app).
32
+
33
+ ## Development
34
+
35
+ ### Dependencies
36
+
37
+ - Recent versions of `node.js` and `pnpm`
38
+ - `rustup`
39
+ - `wasm-bindgen`
40
+ - [Binaryen's `wasm-opt`](https://github.com/WebAssembly/binaryen)
41
+ - [this `wasm-snip` fork](https://github.com/r58Playz/wasm-snip)
42
+
43
+ #### Building
44
+
45
+ - Clone the repository with `git clone --recursive https://github.com/MercuryWorkshop/scramjet`
46
+ - Install the dependencies with `pnpm i`
47
+ - Build the rewriter with `pnpm rewriter:build`
48
+ - Build Scramjet with `pnpm build`
49
+
50
+ ### Running Scramjet Locally
51
+
52
+ You can run the Scramjet dev server with the command
53
+
54
+ ```sh
55
+ pnpm dev
56
+ ```
57
+
58
+ Scramjet should now be running at <http://localhost:1337> and should rebuild upon a file being changed (excluding the rewriter).
59
+
60
+ ### Setting up Typedoc
61
+
62
+ The official Scramjet Typedoc gets deployed via GitHub Actions along with the demo site [here](https://scramjet.mercurywork.shop/typedoc).
63
+
64
+ You can run it locally with:
65
+
66
+ ```
67
+ pnpm run docs
68
+ pnpm docs:dev
69
+ pnpm docs:serve
70
+ ```
71
+
72
+ ### Set up everything
73
+
74
+ Do you want to run the Scramjet demo and Typedoc together like what is served on GitHub Pages by the Action?
75
+
76
+ You can do this by running the serve script:
77
+
78
+ ```sh
79
+ chmod +x scripts/serve-static.sh
80
+ ./scripts/serve-static.sh
81
+ ```
82
+
83
+ This essentially simulates the CI pipeline, but in a shell script.
84
+
85
+ ## Resources
86
+
87
+ - [TN Docs](https://docs.titaniumnetwork.org/proxies/scramjet) - There's a page on TN's docs for Scramjet, which is structured more like a guide if you are an interested proxy site developer.
88
+ - [Scramjet Typedocs](https://scramjet.mercurywork.shop/typedoc) - Contains documentation for Scramjet APIs. This is useful for any proxy site developer.
89
+ - [Scramjet-App](https://github.com/MercuryWorkshop/scramjet-app) - A simple example of a proxy site, which uses Scramjet in a mass-deployable manner. This is based on [Ultraviolet-App](https://github.com/titaniumnetwork-dev/ultraviolet-app) for familiarity.