HTTP Proxy bug

Help
2010-04-07
2013-05-21
  • Marcel Berteler

    Marcel Berteler - 2010-04-07

    After trying to get NuSOAP to work behind a firewall, I found that there was actually a bug in NuSOAP that prevent the HTTP Proxy port from being used.

    The bug is not difficult to replicate:

    $client->setHTTPProxy('192.168.0.1','8080');
    

    should use port 8080 to connect to the HTTP proxy. instead it uses the port it got via the wsdl.

    The fix is easy. Maybe this can be added to this version of NuSOAP as well?

    Around line 2323 in nusoap.php, as part of the 'connect' function in the soap_transport_http class:

    // open socket
    if($connection_timeout > 0){
      $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
    } else {
      $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
    }
    

    should be changed to:

    // open socket
    if($connection_timeout > 0){
      $this->fp = @fsockopen( $host, $port, $this->errno, $this->error_str, $connection_timeout);
    } else {
      $this->fp = @fsockopen( $host, $port, $this->errno, $this->error_str);
    }
    

    marcel

     
  • Marcel Berteler

    Marcel Berteler - 2010-04-07

    Not sure what happened in my previous post, but the new code should read:

    // open socket
    if($connection_timeout > 0){
    $this->fp = @fsockopen( $host, $port, $this->errno, $this->error_str, $connection_timeout);
    } else {
    $this->fp = @fsockopen( $host, $port, $this->errno, $this->error_str);
    }
    
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks