(Updated 3/4/23: V2)
PageSpeed rating of 0/0
Coming Soon
-
npm install alloyproxy
-
Set all of your configs in the main file for the Node app.
-
Start up your app and unblock a website at
/prefix/[BASE64 ENCODED WEBSITE ORIGIN]/
. The path of the website does not have to be B64 encoded.
A good example of what code to use is here using the Express.js framework.
-
Navigate to the
/examples/
folder. -
Do the following commands:
cd examples/express
npm install
npm start
The demo application will run at localhost:8080
by default however the port can be configured in config.json
.
The static folder provides you with the base site if you wish to go manual about this.
Add this to your server-side script ex. "app.js".
// Note: make sure you use Alloy before any other Express middleware that sends responses to client or handles POST data.
const Alloy = require('alloyproxy'),
http = require('http'),
express = require('express'),
app = express();
const server = http.createServer(app);
const Unblocker = new Alloy({
prefix: '/fetch/',
request: [],
response: [],
injection: true,
});
// The main part of the proxy.
app.use(Unblocker.app);
// WebSocket handler.
Unblocker.ws(server);
server.listen('8080')
prefix: '/prefix/',
blocklist: [],
// error: (proxy) => { return res.end('proxy.error.info.message') }, Custom error handling which is optional.
request: [], // Add custom functions before request is made or modify the request.
response: [], // Add custom functions after the request is made or modify the response.
injection: true, // Script injection which is helpful in rewriting window.fetch() and all kinds of client-side JS requests.
requestAgent: null, // Set a custom agent to use in the request.
// userAgent: Uses the clients "User-Agent" request header by default. More customizable using the "request" option in the configs.
localAddress: [] // Neat feature in basic http(s).request() to choose what IP to use to make the request. Will be randomized if there is multiple.