Skip to content

Commit 4586ad0

Browse files
committed
Merge pull request #18 from softius/https
HTTPS Support
2 parents 1f8a1b0 + 643d338 commit 4586ad0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ An application proxy that can be used to transparently transfer all kind of requ
55

66
If it is possible to enable CORS on your application server, this proxy is not necessary. Have a look at [how you can enable CORS on your server](http://enable-cors.org/server.html) for further information.
77

8+
PHP 5.3+
9+
810
Installation
911
--------------
1012

proxy.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
// 'example.com'
3333
);
3434

35+
/**
36+
* Set extra multiple options for cURL
37+
* Could be used to define CURLOPT_SSL_VERIFYPEER & CURLOPT_SSL_VERIFYHOST for HTTPS
38+
* Also to overwrite any other options without changing the code
39+
* See http://php.net/manual/en/function.curl-setopt-array.php
40+
*/
41+
$curl_options = array(
42+
// CURLOPT_SSL_VERIFYPEER => false,
43+
// CURLOPT_SSL_VERIFYHOST => 2,
44+
);
45+
3546
/* * * STOP EDITING HERE UNLESS YOU KNOW WHAT YOU ARE DOING * * */
3647

3748
// identify request headers
@@ -130,6 +141,11 @@
130141
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_params);
131142
}
132143

144+
// Set multiple options for curl according to configuration
145+
if (is_array($curl_options) && 0 <= count($curl_options)) {
146+
curl_setopt_array($ch, $curl_options);
147+
}
148+
133149
// retrieve response (headers and content)
134150
$response = curl_exec($ch);
135151
curl_close($ch);

0 commit comments

Comments
 (0)