-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.js
48 lines (40 loc) · 1.04 KB
/
example.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var Hapi = require('hapi');
var routes = require('./lib/routes');
var server = new Hapi.Server({connections: { routes: { security: true } } });
server.connection({ routes: { cors: true } }).route(routes);
var fuzzerOptions = {
credentials: function (callback) {
setTimeout(function () {
callback(null, { username: 'default', password: 'letmein' });
}, 1000);
},
// credentials: {
// username: 'default',
// password: 'letmein'
// },
maxIterations: 100
};
server.register([{
register: require('good'),
options: {
reporters: [{
reporter: require('good-console'),
args: [{ log: '*' }]
}]
}
}, {
register: require('./'),
options: fuzzerOptions
}], function (err) {
if (err) {
throw err;
}
server.plugins.bizzarolout.fuzz(function (err, res) {
if (err) {
throw err;
}
server.start(function () {
console.log('Server started', server.info.uri);
});
});
});