RE: [PEAR-DEV] XML-RPC over proxy

From: Date: Tue, 10 Jul 2001 17:10:06 +0000
Subject: RE: [PEAR-DEV] XML-RPC over proxy
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-620@lists.php.net to get a copy of this message
Index: RPC.php =================================================================== RCS file: /repository/php4/pear/XML/RPC.php,v retrieving revision 1.2 diff -r1.2 RPC.php 290,291c290,291 < function xmlrpc_client($path, $server, $port=80) { < $this->port=$port; $this->server=$server; $this->path=$path; --- > function xmlrpc_client($path, $server, $port=80,$proxy="", $proxy_port=0) { > $this->port=$port; $this->server=$server; $this->path=$path;$this->proxy = $proxy; $this->proxy_port = $proxy_port ; 315,322c315,332 < function sendPayloadHTTP10($msg, $server, $port, $timeout=0, < $username="", $password="") { < if($timeout>0) < $fp=fsockopen($server, $port, < $this->errno, $this->errstr, $timeout); < else < $fp=fsockopen($server, $port, < $this->errno, $this->errstr); --- > function sendPayloadHTTP10($msg, $server, $port, $timeout=0, $username="", $password="") { > > if($this->proxy){ > if($timeout > 0){ > $fp=fsockopen($this->proxy, $this->proxy_port, $this->errno, $this->errstr, $timeout); > } > else{ > $fp=fsockopen($this->proxy, $this->proxy_port, $this->errno, $this->errstr); > } > } > else{ > if($timeout > 0){ > $fp=fsockopen($server, $port, $this->errno, $this->errstr, $timeout); > } > else{ > $fp=fsockopen($server, $port, $this->errno, $this->errstr); > } > } 336,343c346,362 < < $op= "POST " . $this->path. " HTTP/1.0\r\nUser-Agent: PHP XMLRPC 1.0\r\n" . < "Host: ". $this->server . "\r\n" . < $credentials . < "Content-Type: text/xml\r\nContent-Length: " . < strlen($msg->payload) . "\r\n\r\n" . < $msg->payload; < --- > > if($this->proxy){ > $op= "POST http://" . $this->server . > ":" . $this->port . $this->path. " HTTP/1.0\r\nUser-Agent: PHP XMLRPC 1.0\r\n" . > "Host: ". $this->server . "\r\n" . > $credentials . > "Content-Type: text/xml\r\nContent-Length: " . > strlen($msg->payload) . "\r\n\r\n" . > $msg->payload; > } > else{ > $op= "POST " . $this->path. " HTTP/1.0\r\nUser-Agent: PHP XMLRPC 1.0\r\n" . > "Host: ". $this->server . "\r\n" . > $credentials . > "Content-Type: text/xml\r\nContent-Length: " . > strlen($msg->payload) . "\r\n\r\n" . > $msg->payload; > }

« previous php.pear.dev (#620) next »