Jump to content

Open Url With Proxy


Hamlets666

Recommended Posts

There it is :
[code]<?php
$url = "http://blabla.com";
$x = 0;
$proxy=@file("zz.txt");
foreach($proxy as $v) list($ips[], $ports[]) = explode(':', $v);
//
while($x < 129) { //// There are 130 proxy`s
$x = $x + 1;
$fp = fsockopen($ips[$x], $ports[$x]);
fputs($fp, "GET $url HTTP/1.0\r\nHost: $ips[$x]\r\n\r\n");
while(!feof($fp)){
  $line = fgets($fp, 4000);
  print($line);
}
fclose($fp);
}
?>[/code]

And error : [i]Warning: fsockopen() expects parameter 2 to be long, string given in z:\home\localhost\www\anti2\xy.php on line 8

Warning: fputs(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 9

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11[/i]
.......

Any idea why so? Proxy`s in zz.txt are like [b]33.33.33.33:33[/b]


By the way : when i was writing : [code]<?php
$proxy = "33.33.33.33";
$port = 33;
$url = "http://blabla.com";
$fp = fsockopen($proxy, $port);
fputs($fp, "GET $url HTTP/1.0\r\nHost: $proxy\r\n\r\n");
while(!feof($fp)){
  $line = fgets($fp, 4000);
  print($line);
}
fclose($fp);
?>[/code]
it was ok   :-\
Link to comment
https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/
Share on other sites

Try this [code]<?php
$url = "http://blabla.com";
$proxies = @file("zz.txt");

foreach($proxies as $proxy)
{
list($ip,$port) = explode(':',$v);
$fp = fsockopen($ip,$port);
fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n");
while(!feof($fp))
{
echo fgets($fp, 4000);
}
fclose($fp);
}
?>[/code]

And quit spamming.
Link to comment
https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115754
Share on other sites

Sorry about "spamming"  :)

[code]<?php
$url = "http://blabla.com";
$proxies = @file("zz.txt");

foreach($proxies as $v)
{
list($ip[], $port[]) = explode(':', trim($v));
$fp = fsockopen($ip,$port);
fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n");
while(!feof($fp))
{
echo fgets($fp, 4000);
}
fclose($fp);
}
?>[/code]

It`s last what I tried :) But again : [i]Warning: fsockopen() expects parameter 1 to be string, array given in z:\home\localhost\www\777\newww.php on line 8

Warning: fputs(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 9

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 12

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 12[/i]
And error with line10,12 repeats a lot  :-[
Link to comment
https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115864
Share on other sites

Try this: [code]<?php
$url = "http://blabla.com";
$proxies = @file("zz.txt");

foreach($proxies as $v)
{
list($ip, $port) = explode(':', trim($v));
$fp = fsockopen($ip,$port);
fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n");
while(!feof($fp))
{
echo fgets($fp, 4000);
}
fclose($fp);
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115954
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.