0

Hi I have a php script which tries to do a post. I use Snoopy class and also I use proxy. I managed to post but when I use a proxy the posting is extremely slow. I mean it can take till 30 minutes. I don't want to block my script for 30 minutes waiting for a post. Any idea how could I solve this?

The code looks like:

require('../includes/Snoopy.class.php');

$snoopy = new Snoopy();

$snoopy->proxy_host = "my.proxy.host";

$snoopy->proxy_port = "8080";

$p_data['color'] = 'Red';

$p_data['fruit'] = 'apple';

$snoopy->cookies['vegetable'] = 'carrot';

$snoopy->cookies['something'] = 'value';

$snoopy->submit('http://phpstarter.net/samples/118/data_dump.php', $p_data);

echo '

' . htmlspecialchars($snoopy->results) . '
';
Granit
  • 931
  • 3
  • 12
  • 22
  • Does this happen with other proxies? If not, then the proxy is simply slooooow, and there's probably not much you can do about that, short of using a different proxy. – Piskvor left the building Oct 12 '09 at 09:11
  • I actually have a list of proxies which I use randomly. is there a possibility to give a period of time and the if e.g in 2 minutes submit function does not return to try to change the proxy? – Granit Oct 12 '09 at 09:19

1 Answers1

1
var $read_timeout   =   0;  // timeout on read operations, in seconds 
// set to 0 to disallow timeouts

So, you could try to set $snoopy->read_timeout to any reasonable value.

Alexey
  • 158
  • 3
  • 10