Created
October 10, 2012 20:32
-
-
Save ralphtheninja/3868236 to your computer and use it in GitHub Desktop.
node.js and http CONNECT method
This file contains hidden or 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 server = http.createServer(function(req, res) { | |
| res.writeHead(200, { | |
| 'Content-type': 'application/json' | |
| }); | |
| res.end(JSON.stringify(http.STATUS_CODES)); | |
| }).listen(4000); | |
| server.on('connect', function(req, socket, head) { | |
| // This doesn't fire when doing e.g. curl -X CONNECT localhost:4000 | |
| console.log('CONNECT'); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't have anything to do with node. Apparently -x should be used.