![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jan 2005
Posts: 44
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0
![]() |
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 anywaysif 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. |
|
|
|
|
|
#3 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
Maybe he has a website that was blocked from getting content from a website to display data they needed by an asshole sysadmin...?
__________________
|
|
|
|
|
|
#5 | |
|
Newbie
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0
![]() |
Quote:
__________________
spaghetti code is my only friend.. :cool: |
|
|
|
|
|
|
#6 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Jan 2005
Posts: 44
Rep Power: 0
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|