Skip to content

Instantly share code, notes, and snippets.

@ekaqu
Created June 6, 2012 04:10
Show Gist options
  • Select an option

  • Save ekaqu/2879865 to your computer and use it in GitHub Desktop.

Select an option

Save ekaqu/2879865 to your computer and use it in GitHub Desktop.
http proxy for s3 based off knox (http://thechangelog.com/post/2128784522/knox-s3-lib)
exports.s3 = {
key: '<api-key-here>'
, secret: '<secret-here>'
, bucket: 'learnboost'
};
/*
Run the following to set things up:
npm install knock
*/
var http = require("http"),
config = require("./config.js"),
s3 = require("knox").createClient(config.s3);
http.createServer(function(req, resp) {
s3.get("/path").on("response", function(s3Res) {
s3Res.pipe(resp);
}).end();
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment