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