-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.js
More file actions
30 lines (24 loc) · 788 Bytes
/
Copy pathexample.js
File metadata and controls
30 lines (24 loc) · 788 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 ChallengerPassive = require('./challenger/custom_server');
const ChallengerActive = require('./challenger');
const challenges = require('./exampleChallenges');
const app = new ChallengerPassive({
tls: {
key: ChallengerPassive.loadFile('./example_cert/key.pem'),
cert: ChallengerPassive.loadFile('./example_cert/cert.pem'),
},
});
const host = 'localhost';
const port = 8443;
const challenger = new ChallengerActive();
challenger.setupApp(app);
challenges(challenger);
app.get('/', async (req, res) => {
console.log('New request: /');
res.send(`You are verified! Your JA3 is: ${req.tls.ja3Hash}`);
});
app.get('/submit', async (req, res) => {
res.redirect('/');
});
app.start(host, port, (e) =>
console.log(`Server listening on https://${host}:${port}`)
);