@@ -55,6 +55,12 @@ class Immocaster_Immobilienscout_Rest extends Immocaster_Immobilienscout
5555 */
5656 protected $ _sProtocol = 'http ' ;
5757
58+ /**
59+ * Proxy
60+ **/
61+ protected $ _sProxyName = NULL ;
62+ protected $ _sProxyPort = NULL ;
63+
5864 /**
5965 * Der Constructor legt die Einstellungen für die
6066 * Verbindung fest und startet diese.
@@ -164,6 +170,22 @@ public function setStrictMode($bMode=false)
164170 return false ;
165171 }
166172
173+ /**
174+ * Proxy-Einstellungen
175+ *
176+ * @param string $sProxyName Name (oder IP) des Proxy-Servers
177+ * @param string $sProxyPort optionaler Port (wird auf numeric geprueft)
178+ * @return void
179+ **/
180+ public function setProxy ($ sProxyName ,$ sProxyPort =NULL )
181+ {
182+ $ this ->_sProxyName = $ sProxyName ;
183+ if ($ sProxyPort &&is_numeric ($ sProxyPort ))
184+ {
185+ $ this ->_sProxyPort = $ sProxyPort ;
186+ }
187+ }
188+
167189 /**
168190 * Authentifizierung ohne MySQL Datenbank aktivieren und deaktivieren.
169191 *
@@ -1405,6 +1427,14 @@ private function registerAccess($aArgs)
14051427 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER ,1 );
14061428 curl_setopt ($ ch , CURLOPT_HEADER , 0 );
14071429 curl_setopt ($ ch , CURLOPT_HTTPHEADER , $ opts ['http ' ]);
1430+ if ($ this ->_sProxyName )
1431+ {
1432+ curl_setopt ($ ch , CURLOPT_PROXY , $ this ->_sProxyName );
1433+ if ($ this ->_sProxyPort )
1434+ {
1435+ curl_setopt ($ ch , CURLOPT_PROXYPORT , $ this ->_sProxyPort );
1436+ }
1437+ }
14081438 $ result = curl_exec ($ ch );
14091439 curl_close ($ ch );
14101440 }else {
@@ -1537,6 +1567,15 @@ private function _postVideoToPicsearch($aParameter)
15371567 curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postValues );
15381568 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
15391569
1570+ if ($ this ->_sProxyName )
1571+ {
1572+ curl_setopt ($ ch , CURLOPT_PROXY , $ this ->_sProxyName );
1573+ if ($ this ->_sProxyPort )
1574+ {
1575+ curl_setopt ($ ch , CURLOPT_PROXYPORT , $ this ->_sProxyPort );
1576+ }
1577+ }
1578+
15401579 try
15411580 {
15421581 $ httpDescription = curl_exec ($ ch );
0 commit comments