Created
June 10, 2017 06:25
-
-
Save totetotetotem/fea9b1efae853092a4e27a1b668fe190 to your computer and use it in GitHub Desktop.
SECCON x CEDEC のMITM攻撃で使った偽鯖用スクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var https = require('https'); | |
var fs = require('fs'); | |
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
var port = process.env.PORT || 3000; | |
var options = { | |
key: fs.readFileSync('./keys/server.rsa'), | |
cert: fs.readFileSync('./keys/server.crt') | |
}; | |
var router = express.Router(); | |
router.use(function(req,res,next) { | |
console.log('Something is happening.'); | |
next(); | |
}); | |
router.get('/', function(req,res) { | |
res.json({ message: 'Successfully Posted a test message.' }); | |
}); | |
router.route('/2016/game') | |
.post(function(req,res) { | |
console.log(req.body); | |
var str = 'succeed' + req.body.session; | |
console.log(str); | |
res.end(str); | |
}); | |
app.use('/', router); | |
//http.createServer(app); | |
https.createServer(options,app).listen(port); | |
//app.listen(port); | |
console.log('listen on port' + port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment