Skip to content

Commit

Permalink
Add minimalistic http test servers
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKuehn committed Sep 3, 2019
1 parent 463e1fe commit a9ed352
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/http/429.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let http = require('http');

let port = 8080;

http.createServer(function(req, res) {
console.log('incomming request!');
console.log('method: ', req.method);
console.log('url: ', req.url);
console.log('header: ', req.headers);
res.writeHead(429, {'Content-Type': 'text/plain', 'Retry-After': 3600});
res.end('Yikes! Your\'re blocked!');
}).listen(port);

console.log('Starting super simple http server on localhost:' + port + '!');
14 changes: 14 additions & 0 deletions test/http/captcha.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let http = require('http');

let port = 8080;

http.createServer(function(req, res) {
console.log('incomming request!');
console.log('method: ', req.method);
console.log('url: ', req.url);
console.log('header: ', req.headers);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Such Captcha! Much Protec! www.google.com/recaptcha/api.js Wow!');
}).listen(port);

console.log('Starting super simple http server on localhost:' + port + '!');

0 comments on commit a9ed352

Please sign in to comment.