Skip to content

Instantly share code, notes, and snippets.

@ralphtheninja
Created October 10, 2012 20:32
Show Gist options
  • Save ralphtheninja/3868236 to your computer and use it in GitHub Desktop.
Save ralphtheninja/3868236 to your computer and use it in GitHub Desktop.
node.js and http CONNECT method
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');
});
@ralphtheninja
Copy link
Author

Doesn't have anything to do with node. Apparently -x should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment