Add proxy port.
authorJan Schneider <jan@horde.org>
Tue, 12 Jan 2010 10:06:19 +0000 (11:06 +0100)
committerJan Schneider <jan@horde.org>
Tue, 12 Jan 2010 11:46:04 +0000 (12:46 +0100)
framework/Http/lib/Horde/Http/Client.php
framework/Http/lib/Horde/Http/Request/Base.php
framework/Http/lib/Horde/Http/Request/Curl.php
framework/Http/lib/Horde/Http/Request/Fopen.php
framework/Http/lib/Horde/Http/Request/Peclhttp.php

index 9c9045d..6f57c4a 100644 (file)
@@ -54,6 +54,7 @@ class Horde_Http_Client
      *                    - request.method
      *                    - request.data
      *                    - request.proxyServer
+     *                    - request.proxyPort
      *                    - request.proxyUser
      *                    - request.proxyPass
      *                    - request.timeout
index d6f72b9..73e9e91 100644 (file)
@@ -73,6 +73,12 @@ abstract class Horde_Http_Request_Base
     protected $_proxyServer = null;
 
     /**
+     * Proxy port
+     * @var string
+     */
+    protected $_proxyPort = null;
+
+    /**
      * Proxy username
      * @var string
      */
index 44528ba..11dc1ca 100644 (file)
@@ -65,6 +65,9 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base
         // Proxy settings
         if ($this->proxyServer) {
             curl_setopt($curl, CURLOPT_PROXY, $this->proxyServer);
+            if ($this->proxyPort) {
+                curl_setopt($curl, CURLOPT_PROXYPORT, $this->proxyPort);
+            }
             if ($this->proxyUsername && $this->proxyPassword) {
                 curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxyUsername . ':' . $this->proxyPassword);
                 curl_setopt($curl, CURLOPT_PROXYAUTH, $this->_httpAuthScheme($this->proxyAuthenticationScheme));
index 7b53dc4..af36586 100644 (file)
@@ -45,6 +45,9 @@ class Horde_Http_Request_Fopen extends Horde_Http_Request_Base
         // Proxy settings
         if ($this->proxyServer) {
             $opts['http']['proxy'] = 'tcp://' . $this->proxyServer;
+            if ($this->proxyPort) {
+                $opts['http']['proxy'] .= ':' . $this->proxyPort;
+            }
             $opts['http']['request_fulluri'] = true;
             if ($this->proxyUsername && $this->proxyPassword) {
                 // @TODO check $this->proxyAuthenticationScheme
index 06c7f65..b607bf9 100644 (file)
@@ -75,6 +75,9 @@ class Horde_Http_Request_Peclhttp extends Horde_Http_Request_Base
         // Proxy settings
         if ($this->proxyServer) {
             $httpOptions['proxyhost'] = $this->proxyServer;
+            if ($this->proxyPort) {
+                $httpOptions['proxyport'] = $this->proxyPort;
+            }
             if ($this->proxyUsername && $this->proxyPassword) {
                 $httpOptions['proxyauth'] = $this->proxyUsername . ':' . $this->proxyPassword;
                 $httpOptions['proxyauthtype'] = $this->_httpAuthScheme($this->proxyAuthenticationScheme);