Akkari Posted January 26, 2011 Share Posted January 26, 2011 Hello there everyone. I'll try to explain as thorough as I can so please bare with me a bit. One you want to surf the web through a proxy in firefox, you go to tools > options > network > settings and enter proxy details which for example are like this. 173.123.123.4 and port 8080. I want to do pretty much the same thing with php for my visitors. I have www.site1.com which will have all my scripts and stuff. I want it to somehow redirect or load to www.site2.com USING A PROXY so that when the visitor reach site2, it's as if they have edited their firefox settings to view site2 using a proxy. That way visitors will always be anonymous on www.site2.com. While searching, I found this: http://stackoverflow.com/questions/3889715/php-requests-through-proxy Which seems simple enough but does not work unfortunately. Not that I'm even sure that it's indeed what I want to do but it seems like it...lol. Thanks a lot for any help provided. Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/ Share on other sites More sharing options...
BlueSkyIS Posted January 26, 2011 Share Posted January 26, 2011 so you want to duplicate the content and functionality of another site that you do not own on your own site without the user knowing? Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165553 Share on other sites More sharing options...
Akkari Posted January 26, 2011 Author Share Posted January 26, 2011 so you want to duplicate the content and functionality of another site that you do not own on your own site without the user knowing? Thanks for your response. Nope. I simply want to redirect them to the real site2.com but "anonymized". Just like how the network settings in firefox work as in the example above. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165564 Share on other sites More sharing options...
BlueSkyIS Posted January 26, 2011 Share Posted January 26, 2011 so you want to set your server up as a proxy server? does the site2.com domain every change? are you trying to target "all domains"? you will not be able to get PHP to work as proxy to just any site, especially not any sites that use sessions or cookies. Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165567 Share on other sites More sharing options...
Akkari Posted January 26, 2011 Author Share Posted January 26, 2011 Yes you can say that. The government here in Egypt is censoring the web because of the protests. Perhaps you've already heard a bit. So I'm trying to code a simple solution that'll allow users to access twitter and bypass what's happening. They don't want people not talk. So there aren't any bad intentions as you were thinking Hope it's clear now! Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165585 Share on other sites More sharing options...
BlueSkyIS Posted January 26, 2011 Share Posted January 26, 2011 if you want to provide access to twitter, i suggest that you use the twitter API. same is true for facebook and other similar social networking sites. there is no simple PHP solution to act as a full proxy to "any" website. in fact, it is (practically) impossible to write PHP to access some websites where the browser is required to execute javascript, for instance. So, I would use API's when available or host an actual proxy. Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165672 Share on other sites More sharing options...
Akkari Posted January 26, 2011 Author Share Posted January 26, 2011 That's a pretty helpful reply, thanks. I tried Curl (new to it) and was able to access from my PC and bypass protection. HOWEVER: 1. javascript did not seem to work. Can't those javascript issues be fixed on curl? 2. No links would work. (I think because they were relative links because when I clicked login it went to mydomain.com/login not twitter.com/login). Is there a way around that? How does a service like hidemyass.com manage to load sites flawlesly with all the js and everything? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165681 Share on other sites More sharing options...
BlueSkyIS Posted January 26, 2011 Share Posted January 26, 2011 1. no, curl will not execute javascript. 2. if you want relative links to continue working, you'll have to find them and convert them to complete urls. hidemyass.com is a proxy server which simply passes all code (including javascript) to the browser, and then the browser executes it. note: javascript is a client-side language executed by the browser. this makes it useful in detecting real browsers versus server-side code like PHP pretending to be a real browser. Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165687 Share on other sites More sharing options...
Akkari Posted January 26, 2011 Author Share Posted January 26, 2011 hmmm understood thanks. So hidemyass doesn't use curl, what does it use then? Also in its case the IP I get when surfing through them is the IP of their server right? So how is it possible to allow users to use my server as a proxy with fully working javascript and stuff? I'd be grateful if you could point me to a tutorial or recommend a script. Thanks again and sorry for the headache! Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165707 Share on other sites More sharing options...
BlueSkyIS Posted January 26, 2011 Share Posted January 26, 2011 hidemyass is a proxy server http://en.wikipedia.org/wiki/Proxy_server they simply pass data through their network to you, then back out. if you want to do the same thing, you'll have to install proxy server software http://www.google.com/search?client=safari&rls=en&q=proxy+server+software&ie=UTF-8&oe=UTF-8 Quote Link to comment https://forums.phpfreaks.com/topic/225754-php-requests-through-proxies-help-appreciated/#findComment-1165720 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.