Skip to content

Instantly share code, notes, and snippets.

@kevinohara80
Created May 15, 2012 00:02
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 kevinohara80/2698189 to your computer and use it in GitHub Desktop.
Save kevinohara80/2698189 to your computer and use it in GitHub Desktop.
node.js proxy to salesforce REST
var fs = require('fs');
var bouncy = require('bouncy');
// load up your instance and port into environment variables
var instance = (process.env.instance) ? process.instance.env : 'na1';
var port = (process.env.port) ? process.env.port : 443;
// self-signed certificate created with openssl
var opts = {
key : fs.readFileSync(__dirname + '/key.pem'),
cert : fs.readFileSync(__dirname + '/certificate.pem')
};
// proxy api requests to the salesforce endpoint
bouncy(opts, function (req, bounce) {
bounce(instance + '.salesforce.com');
}).listen(port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment