Created
August 30, 2012 14:15
-
-
Save sifu/3529379 to your computer and use it in GitHub Desktop.
proxy http -> https (cloudant)
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
#!/usr/bin/env node | |
var httpProxy = require( 'http-proxy' ); | |
var server = httpProxy.createServer( function( req, res, proxy ) { | |
proxy.proxyRequest( req, res, { | |
host: 'sifu.cloudant.com', | |
port: 443, | |
https: true | |
} ); | |
} ); | |
server.listen( 8000 ); | |
// curl https://sifu.cloudant.com/test | |
// -> {"update_seq":"16-g1AAAADjeJzLYWBgYMl.... | |
// curl http://localhost:8000/test | |
// -> An error has occurred: {"code":"ECONNRESET"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment