Created
May 15, 2013 19:40
-
-
Save zemirco/5586728 to your computer and use it in GitHub Desktop.
node proxy basic auth
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 cors_proxy = require("corsproxy"); | |
var http_proxy = require("http-proxy"); | |
cors_proxy.options = { | |
// this is not working | |
target: "user:pw@https://mirco.cloudant.com/pouchdb" | |
}; | |
http_proxy.createServer(cors_proxy).listen(1234, function() { | |
console.log('cors proxy server listening on port 1234') | |
}); | |
// i know i have to set the 'Authorization' header, but where? | |
header.Authorization = 'Basic ' + new Buffer('user' + ':' + 'pw').toString('base64'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
crossDomain
flag with each XHR request as well. Try to make a request with jQuery first. If that works, ask over at PouchDB where to set the flag