开发者

How to implement a proxy site in PHP?

Like this one:

https://aniscartujo.co开发者_运维问答m/webproxy/default.aspx?prx=http://google.com


Check out PHProxy: http://lifehacker.com/5447726/install-phproxy-in-your-web-space-to-access-blocked-sites

Download: http://sourceforge.net/projects/poxy/

I have actually used this at high school on my site: http://bypass.provanix.com/ and added a login.

Edit:

If you want to try it out, login with username "default" and password "default". I'm still working on the YouTube workaround - it used to work, but the site changed.


<form><input name=url><input type=submit></form>

Once the form is submitted you'll receive in your php a post variable named "url" where the user has typed the url to surf, the simple way to implement in php is:

echo file_get_contents($_POST['url']);

NB: in order to use file_get_contents properly you should have allow_url_fopen enabled in you php.ini


Using squid with a custom url-rewriter (maybe written in PHP) would provide all the required functionality - why start from scratch?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜