Last active
August 29, 2015 14:05
-
-
Save chevcast/2969118335b2f969e74a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
router.get('/google', function (req, res) { | |
var url = 'http://www.google.com'; | |
request(url, function (err, response, body) { | |
res.send(body.replace(/(action|src|href)="((?!http)[^"]*)"/gi, function (match, g1, g2) { | |
return g1 + '="' + url + g2 + '"'; | |
})); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I faked the user-agent header as well and now the sites think my server-side requests come from Chrome.
Now you can pass any website as a query parameter.
(e.g.
http://localhost:3000?site=http://twitter.com
)