Skip to content

Instantly share code, notes, and snippets.

@tjanczuk
Created February 14, 2012 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjanczuk/1823175 to your computer and use it in GitHub Desktop.
Save tjanczuk/1823175 to your computer and use it in GitHub Desktop.
Direct HTTPS request
require('https').get({ host: 'github.com' }, function (bres) {
res.writeHead(bres.statusCode);
bres.pipe(res);
}).on('error', function (err) {
res.writeHead(500);
res.end('Error talking to backend: ' + err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment