Jump to content

PHP Requests through Proxies? Help appreciated!


Akkari

Recommended Posts

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.

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.