@@ -55,6 +55,12 @@ class Immocaster_Immobilienscout_Rest extends Immocaster_Immobilienscout
55
55
*/
56
56
protected $ _sProtocol = 'http ' ;
57
57
58
+ /**
59
+ * Proxy
60
+ **/
61
+ protected $ _sProxyName = NULL ;
62
+ protected $ _sProxyPort = NULL ;
63
+
58
64
/**
59
65
* Der Constructor legt die Einstellungen für die
60
66
* Verbindung fest und startet diese.
@@ -164,6 +170,22 @@ public function setStrictMode($bMode=false)
164
170
return false ;
165
171
}
166
172
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
+
167
189
/**
168
190
* Authentifizierung ohne MySQL Datenbank aktivieren und deaktivieren.
169
191
*
@@ -1405,6 +1427,14 @@ private function registerAccess($aArgs)
1405
1427
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER ,1 );
1406
1428
curl_setopt ($ ch , CURLOPT_HEADER , 0 );
1407
1429
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
+ }
1408
1438
$ result = curl_exec ($ ch );
1409
1439
curl_close ($ ch );
1410
1440
}else {
@@ -1537,6 +1567,15 @@ private function _postVideoToPicsearch($aParameter)
1537
1567
curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postValues );
1538
1568
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
1539
1569
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
+
1540
1579
try
1541
1580
{
1542
1581
$ httpDescription = curl_exec ($ ch );
0 commit comments