Holy-Unblocker/src/alloyproxy/examples/app.js
TheEmeraldStarr 27b55eb78e Minor Edits
2021-02-28 12:01:47 -08:00

29 lines
574 B
JavaScript

// 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);
// Do your stuff here! :3
// WebSocket handler.
Unblocker.ws(server);
server.listen('8080')