-
- CommentAuthorconartistdesigns
- CommentTimeAug 23rd 2008
I've been having cravings to vreate web tools just for the learning experience and my next thought would be making a really simple proxy. I was researching Oracle at school and what do you know... wikipedia is blocked by websence. lame town. so i figured if i told my server to fetch the info and display it on a yemp page then that would work. Is this how proxys work? How does it display images and use css when the links to them are relative? -
- CommentAuthorSunRise
- CommentTimeAug 24th 2008
As for PHP proxies
css and javascript are copied to local files on your server. Links are rewritten by the script so that google.com/info becomes something like yoursite.com/proxy.php?url=google.com/info
The other kind of proxy simply passes requests from the client to the server and sends page from the server to client. The kind you will be able to code is the first one however.
-
- CommentAuthorkalyan
- CommentTimeAug 25th 2008
con, thats exactly how a proxy works
images and css are also retreived the same way normal html pages are.
Its upto you to deal with creating absolute links for "relative links", css, images etc and then fetching them.
Proxy's are usually written in php with cUrl ( my favorite ), or sockets ( fsock ). If u use cUrl, you can also enable a proxy to do login stuff easily... -
- CommentAuthorSunRise
- CommentTimeAug 25th 2008 edited by SunRise on the 25th August 2008 at 18:44:48 EDT
How do you do login stuff? and youtube?
you know of any already done php code that is better than self written stuff? -
- CommentAuthorkalyan
- CommentTimeAug 25th 2008
Login stuff is pretty straight forward and simple, since you will be processing all sorts of requests( css, images, form-action, links ) etc, all you will need to do is get the post fields with $_POST, and set the post headerscurl_setopt( $ch, CURLOPT_POSTFIELDS, "user=kalyan&pass=123&remember=123" );,
// get the string from $_POST, can use implode('&',$_POST)
More curl at http://www.php.net/manual/en/function.curl-setopt.php
Yea, there are pre made scripts ... take a look at php-proxy (sourceforge), ( hundreds of http proxy websites run on it )
1 to 5 of 5
