Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 29th, 2005, 4:49 PM   #1
magic_e
Programmer
 
Join Date: Jan 2005
Posts: 44
Rep Power: 0 magic_e is on a distinguished road
Connecting to a proxy?

hi all,
can any1 please tell me if it is possible to connect to a proxy via php and then once connected to a proxy connect to another site, then once it's connected to a site via the proxy to get the contents of the page


thanx in advanced


magic_e
magic_e is offline   Reply With Quote
Old Jul 4th, 2005, 11:26 AM   #2
clearbit
Newbie
 
clearbit's Avatar
 
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0 clearbit is on a distinguished road
yes yes, i know all about this i have made quite a few scripts for proxies..but ive also had several..well..misfortunes with school systems saying how I aposed a threat to their system yada yada yada..its not my fault 153 people were using my proxy..but anyways

if you need help getting started..the only place to go is www.hotscripts.com tutorials and all, even scripts you can download to help you out.

learn about sockets and it will be no problem.
clearbit is offline   Reply With Quote
Old Jul 4th, 2005, 12:29 PM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
There are many open proxies dotting the internet. There are even tools that change you to a different proxy at a certain frequency. Why use a php script instead of just specifying a proxy in the browser options?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Jul 4th, 2005, 4:58 PM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Maybe he has a website that was blocked from getting content from a website to display data they needed by an asshole sysadmin...?
__________________

tempest is offline   Reply With Quote
Old Jul 8th, 2005, 10:21 PM   #5
clearbit
Newbie
 
clearbit's Avatar
 
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0 clearbit is on a distinguished road
Quote:
Originally Posted by tempest
Maybe he has a website that was blocked from getting content from a website to display data they needed by an asshole sysadmin...?
yes, content may be blocked, and the script will work. But if you wish to use it for this purpose I'd like to tell you to watch out. If your buisness or school thinks your getting access to something your not suppose to, you could lose your job, or be suspended..for breaking "the rules". sorry, but i know.
__________________
spaghetti code is my only friend.. :cool:
clearbit is offline   Reply With Quote
Old Jul 9th, 2005, 12:54 AM   #6
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Risks aside. If this is for browsing (having your php script return the page to you for viewing), an SSL proxy would be easier and perhaps more effective. I've seen web filters that scan for keywords in the returned document, but not filters that will stage a man in the middle attack for every SSL connection.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Jul 30th, 2005, 1:07 PM   #7
magic_e
Programmer
 
Join Date: Jan 2005
Posts: 44
Rep Power: 0 magic_e is on a distinguished road
thanks for all the help i've worked out the whole proxy business and can now get any site to be shown in the browser via a proxy, but the links are still linked to the main site and when you click them they go directly to the site and not through the proxy first??

The code i use to prase the urls doesn't seem to be working correctly

[PHP]
function strip_url($data,$url,$proxy){
preg_match_all("#\s(href|src|action|codebase|url)=([\"\'])?(.*?)([\"\'])?([\s\>])#i", $data, $matches, PREG_SET_ORDER);
foreach ($matches as $match)
{
$replace = ' '.$match[1] . '=' . $match[2] . 'index.php' . '?url=' .$url.$match[3].' '.$match[4].$match[5];
$body = str_replace($match[0],$replace,$data);

}
echo $body;
}
[/PHP]
when i echo $body out side of the foreach loop it will display the un-edited data but if i place it inside the loop it will display the page each time it finds a match yet it still doesn't replace the links

thanks in advanced

magic e
magic_e is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:02 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC