1

I have set up a simple php proxy

 $proxy = 'tcp://127.0.0.1:8080';

 $context = array(
    'http' => array(
               'proxy' => $proxy,
               'request_fulluri' => True,
    ),
 );

 $context = stream_context_create($context);

 $body = file_get_contents("http://www.php.net", False, $context);
 print $body

I want to be able to make ajax request from one subdomain to another. Unfortunately the code above does not work yet. When I make an request the script loads for a long time without success.

Any ideas?

3
  • 1
    If I do only $body = file_get_contents("http://www.php.net"); print $body; then it is working and yours is working too Commented Mar 1, 2011 at 7:15
  • what error? on error.log Commented Mar 1, 2011 at 7:18
  • thanks, $body = file_get_contents("php.net"); worked Commented Mar 1, 2011 at 8:35

1 Answer 1

2

I'm not sure if you understood AJAX proxy correctly. Check out this article, it's stated there that PHP script itself is a proxy, so there's no need to use tcp proxy via streams.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.