Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3997892
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:27:28+00:00 2026-05-20T07:27:28+00:00

<?php class Isis_Expl { const USERAGENT = ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; ru;

  • 0
<?php
class Isis_Expl
{
    const USERAGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13';

    public static $ch;

    public static $proxyType;
    public static $proxy;
    public static $postFields;
    public static $cookie;

    public static function setProxy($proxy, $proxyType = '1')
    {
        self::$proxy = $proxy;
        switch ($proxyType)
        {
            case '4':
                self::$proxyType = 'CURLPROXY_SOCKS4';
                break;
            case '5':
                self::$proxyType = 'CURLPROXY_SOCKS5';
                break;
            default:
                break;
        }
    }

    public static function init($url)
    {
        self::$ch = curl_init();
        curl_setopt(self::$ch, CURLOPT_URL, $url); 
        curl_setopt(self::$ch, CURLOPT_REFERER, $url);        
        curl_setopt(self::$ch, CURLOPT_HEADER, 1);
        curl_setopt(self::$ch, CURLOPT_USERAGENT, self::USERAGENT);
        curl_setopt(self::$ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt(self::$ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt(self::$ch, CURLOPT_TIMEOUT, 15);
        curl_setopt(self::$ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt(self::$ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        self::_getProxy();
        self::_getPost();
        self::_getCookie();

        $content = curl_exec(self::$ch); 

        if (curl_errno(self::$ch))
        {
            echo curl_error(self::$ch);
            return false;
        }
        else
        {
            return $content;
        }
    }

    protected function _getProxy()
    {
        if (self::$proxyType) curl_setopt(self::$ch, CURLOPT_PROXYTYPE, self::$proxyType);        
        if (self::$proxy) curl_setopt(self::$ch, CURLOPT_PROXY, self::$proxy);
    }

    protected function _getPost()
    {
        if (self::$postFields)
        {
            curl_setopt(self::$ch, CURLOPT_POST, 1);
            curl_setopt(self::$ch, CURLOPT_POSTFIELDS, self::$postFields);
        }
    }

    protected function _getCookie()
    {
        if (self::$cookie) curl_setopt(self::$ch, CURLOPT_COOKIE, self::$cookie);
    }   
}

Isis_Expl::setProxy('XXX.XXX.XXX.XXX:XXXX');
echo Isis_Expl::init('http://google.com');

Output: Recv failure: Connection was reset

But if I commented “//Isis_Expl::setProxy(‘XXX.XXX.XXX.XXX:XXXX’);” that output is ok..
Where is a problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:27:28+00:00Added an answer on May 20, 2026 at 7:27 am

    First off, don’t use a static class when an instance would be more appropriate. You have state here, so use an instance. Secondly, you may want to name your methods better. _getProxy() I would think would return something, not effect the state of the app.

    Now, for your exact question:

    1. Is it a HTTP proxy? If so, should you be setting CURLOPT_HTTPPROXYTUNNEL to true?

    2. You’re declaring proxyType to be 1 by default in setProxy, but then you never set self::$proxyType. And you never set CURLOPT_PROXYTYPE to CURLPROXY_HTTP (you shouldn’t need to, but I’d be explicit).

    3. You never declare any authentication for the proxy. Is it an open proxy?

    4. Are you sure the proxy is actually listening on that IP and Port? That’s a non-standard port… Try opening a connection from the server and see what happens:

      $f  = fsockopen('XXX.XXX.XXX.XXX', 'XXXX');
      if (!$f) die('Server not accepting connections');
      fwrite($f, "q\r\n\r\n");
      var_dump(fread($f, 4048));
      fclose($f);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following PHP class code class SuperIdea{ . . . static function getById($id){
If I have a PHP class such as this one: class A { public
I am java and php programmer. In java i can use static class/method so
Why PHP class does not return <h1>404</h1><p>Not found</p> ? class checkid{ public $title; public
class_1.php class class_1 { public function __construct() { require_once $_SERVER['DOCUMENT_ROOT'].'/array.php'; } } class_2.php class
My PHP class looks like that. <?php class htmlize { protected $base_dir; public function
Is there a PHP class/library that would allow me to query an XHTML document
I have a PHP class that creates a PNG image on the fly and
I currently have my PHP class variables set up like this: class someThing {
I have certain PHP class methods that access external variables. These variables are not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.