Wednesday 16 December 2015

Reverse proxy for image gallery

I've got an image gallery with links to images on different random hosts (can't host em myself)Since the server is HTTPS, I figured I could get the images with node.So currently I'm editing the URL's for the images before sending them to the clients, then doing thisvar request = require('request') app.get('/gallery', function (req, res) { var url = req.url.slice(req.url.indexOf('?url=') + 5) req.pipe(request(url)).pipe(res) }) It seems to work just fine... My question is if I should consider something more. Security / other quirks?

Submitted December 17, 2015 at 02:10AM by Cuel

No comments:

Post a Comment