It doesn't seem to be working.
Any help would be greatly appreciated!
Here is some more information/versions/stats to help:
Server: RHEL, PHP 5.1.6, cakephp 1.2.3.8166
Proxy: Squid/2.5 stable
This is my test shell:
<?php
class TesterShell extends Shell
{
function httpsockproxy()
{
$uri = 'http://www.google.com';
if(isset($this->args[0]))
{
$uri = $this->args[0];
}
App::import('Core', 'HttpSocket');
$HttpSocket = new HttpSocket();
$request = $HttpSocket->request(array(
'method' => 'POST',
'host'=>'[proxyhostname]:[port]',
'uri'=>'http://www.google.com'
));
print_r($request);
print_r($HttpSocket->config);
}
}
the print_r($request) is getting a response from the squid proxy
server; however, the proxy is returning it's html error instead of
google's homepage:
...
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="/">/</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Invalid URL
</STRONG>
</UL>
....
the print_r($HttpSocket->config) output is:
Array
(
[persistent] =>
[host] => [proxyhostname]:[port]
[protocol] => 6
[port] => 80
[timeout] => 30
[request] => Array
(
[uri] => Array
(
[scheme] => http
[host] => www.google.com
[port] => 80
)
[auth] => Array
(
[method] => Basic
[user] =>
[pass] =>
)
[cookies] => Array
(
)
)
)
On Dec 15, 8:56 am, fr3nch13 <[email protected]> wrote:
> Thanks!
>
> I'll try this out and let this group know if it was successful.
>
> On Dec 14, 10:04 pm, gianpaulo <[email protected]> wrote:
>
> > Try this:
>
> > $HttpSocket = new HttpSocket();
> > $request = $HttpSocket->request(array(
> > 'host'=>'<proxy server address>:<proxy server port>',
> > 'uri'=>'http://api.yahoo.com/'
> > ));
>
> > This is how powerful CakePHP is :D
>
> > On Dec 15, 8:48 am, fr3nch13 <[email protected]> wrote:
>
> > > Has anyone tried using a proxy server with HttpSocket?
>
> > > I have been looking all over via the normal channels (google, api,
> > > bakery, book, etc.) to no avail.
>
> > > If so, could you please point me in the right direction?
>
>
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en