The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 21, 2019, 12:17:38 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Tough Proxy problem..... so I came to the best for help...  (Read 3282 times)
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« on: August 06, 2011, 07:39:17 PM »

This thing has eaten my lunch.. been working on it for 4 days.. searched all over hell and high water and tried every code snippet this side of the Mississippi and not one has worked for me... so I came to the experts... that is Perk.. to find a solution...
1. the url is live but xxx as not looking for a backlink.
2. If I use the blank proxy it connects fine.. but no matter what proxy I use no connect..
3. IF connection is made it will return your own IP just like IP chicken does... as that is just a test site..
4. The url is live and working... if you visit direct via browser you will see your IP..
5. I will forever be in your debt if you can see what I have done wrong...

thanks in advance....

Code:
<?php
function getPage($proxy$url$referer$agent$header$timeout) {
    
$ch curl_init();
    
curl_setopt($chCURLOPT_URL$url);
    
curl_setopt($chCURLOPT_HEADER$header);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_PROXY$proxy);
    
curl_setopt($chCURLOPT_HTTPPROXYTUNNEL1);
    
curl_setopt($chCURLOPT_CONNECTTIMEOUT$timeout);
    
curl_setopt($chCURLOPT_REFERER$referer);
    
curl_setopt($chCURLOPT_USERAGENT$agent);

    
$result['EXE'] = curl_exec($ch);
    
$result['INF'] = curl_getinfo($ch);
    
$result['ERR'] = curl_error($ch);

    
curl_close($ch);

    return 
$result;
}



// $proxy = '213.238.3.50:8080';

$proxy '';


$str getPage($proxy'hxxp://www.vahud.com/blognew/forward.php''hxxp://www.google.com''Mozilla'15);

print 
"<pre>";
print_r ($str);
print 
"</pre>";


Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: August 07, 2011, 02:06:40 PM »

Wait, Tommy - are you saying that if you proxy through to one of your sites it works, and if you direct-connect to the target site it works, but if you proxy to the target site it doesn't?

If this is the case then it's just clear that the site is blocking the proxy.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #2 on: August 07, 2011, 04:16:10 PM »

Well, Its my VPS and I did not block proxy... and I can ask but since I rent the whole VPS my host would not care but I can ask to make sure... besides there is no problem when I use a new IP in my ie browser... or if I go to one of the sites that let you viist their sites thru their proxy.... I have tried on dozens of sites and never got a connection at any site.... could you point it to your site and see if it works for you.... I have seen this code claim to work all voer the web... but never worked for me.. so I was guessing that maybe I am doing something wrong...

I have also put it in a loop and run as many as a hundered tested proxys across it in a matter of minutes... still never connected....

I am at a loss.... can anyone point this code to any site and get it to work... I can dump anyone a batch of tested proxies if someone wants to test it... I just want to be able to connect to any site so I know it works.. but I can't even do that..

Wow! It can't be that hard..
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #3 on: August 07, 2011, 04:19:23 PM »

Well, Its my VPS and I did not block proxy... and I can ask but since I rent the whole VPS my host would not care but I can ask to make sure... besides there is no problem when I use a new IP in my ie browser... or if I go to one of the sites that let you viist their sites thru their proxy.... I have tried on dozens of sites and never got a connection at any site.... could you point it to your site and see if it works for you.... I have seen this code claim to work all voer the web... but never worked for me.. so I was guessing that maybe I am doing something wrong...

I have also put it in a loop and run as many as a hundered tested proxys across it in a matter of minutes... still never connected....

I am at a loss.... can anyone point this code to any site and get it to work... I can dump anyone a batch of tested proxies if someone wants to test it... I just want to be able to connect to any site so I know it works.. but I can't even do that..

Wow! It can't be that hard..


Well not really direct connect...
Yes.. if I navigate to the site thru a browser.. all is well it prints my ip..
and if I visit with this proxy program with the $proxy = ''  blank.. that is what I meant connect direct with the proxy program set for do not use proxy.... but as soon as you set proxy to $proxy = "any proxy ip:port" even thoroughgly tested proxy... no connect..
Logged
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #4 on: August 07, 2011, 11:42:39 PM »

Your code works.

Increase your timeout to at least 30 and try with this proxy:

61.247.43.92:8080

Your problem is the proxies.

I have to test my proxies (open public proxies), 24/7 and the best ones
are still slow and still fail often.  They are a horrible pain in the ass, but,
they are free and have no TOS. Wink

Bompa



« Last Edit: August 07, 2011, 11:44:35 PM by Bompa » Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #5 on: August 08, 2011, 08:58:28 AM »

Well no luck still... or firefox or IE7... but will use your idea of more time out... using 50 now... and try a lot of other proxies and see what happens.... haven't had any luck with private proxy either... but will keep trying... thanks for what you have done so far..... going to get a loop of maybe 100 tested proxies and try with the 50 delay..
Will let you know...

Code:
Array
(
    [EXE] =>
    [INF] => Array
        (
            [url] => http://www.vahud.com/blognew/forward.php
            [content_type] =>
            [http_code] => 0
            [header_size] => 0
            [request_size] => 0
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 20.997794
            [namelookup_time] => 0.000102
            [connect_time] => 0
            [pretransfer_time] => 0
            [size_upload] => 0
            [size_download] => 0
            [speed_download] => 0
            [speed_upload] => 0
            [download_content_length] => -1
            [upload_content_length] => -1
            [starttransfer_time] => 0
            [redirect_time] => 0
        )

    [ERR] => couldn't connect to host
)
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #6 on: August 08, 2011, 09:05:59 AM »

[total_time] => 20.997794

Not sure if this is the time it took to work, but no matter what the time I use, 30, 50, or even 100 timeout... it seems to come back with the results in 20 seconds or so..
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!