Skip to content

Instantly share code, notes, and snippets.

@diorahman
Created July 30, 2012 03:04
Show Gist options
  • Save diorahman/3203854 to your computer and use it in GitHub Desktop.
Save diorahman/3203854 to your computer and use it in GitHub Desktop.
Proxy Image
var request = require('request')
var express = require('express')
var server = express.createServer()
server.get('/image', function(req, res){
var url = req.query.url ? req.query.url : ""
if(url)
request(url).pipe(res)
else
res.send(400)
})
server.listen(8000)
@diorahman
Copy link
Author

e.g.

curl http://localhost:8000/image?url=http://s1-02.twitpicproxy.com/photos/full/627012991.jpg?key=1000562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment