forked from FogNetwork/Rusty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (25 loc) · 681 Bytes
/
index.js
File metadata and controls
30 lines (25 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const port = "8080"
const Corrosion = require('./lib/server')
const express = require('express')
const app = express()
const proxy = new Corrosion({
prefix: "/service/",
codec: "xor",
title: "Rusty",
forceHttps: true,
requestMiddleware: [
Corrosion.middleware.blacklist([
"accounts.google.com",
], "Page is blocked"),
]
})
app.use('/', express.static(__dirname + '/public'));
app.get('/', (req, res) => {
res.sendFile(__dirname + "/public/index.html")
});
app.use('/', function (req, res) {
proxy.request(req,res)
});
app.listen(process.env.PORT || port, () => {
console.log(`Rusty is running at localhost:${port}`)
})