File tree Expand file tree Collapse file tree
emhttp/plugins/dynamix/include Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,12 +58,17 @@ function proxy_online($proxyUrl) {
5858 $ rc = true ;
5959
6060 if ($ proxyUrl ) {
61+ /*Define the check URL */
62+ $ checkurl = "http://www.msftncsi.com/ncsi.txt " ;
6163 /* Initialize cURL session. */
62- $ ch = curl_init ("http://www.msftncsi.com/ncsi.txt " );
63-
64+ $ ch = curl_init ($ checkurl );
65+
66+ /* Determine if tunneling is needed (HTTPS only). */
67+ $ isHttps = (parse_url ($ checkurl , PHP_URL_SCHEME ) === 'https ' );
68+
6469 /* Set cURL options. */
6570 curl_setopt ($ ch , CURLOPT_CONNECTTIMEOUT , 3 ); /* Timeout in seconds. */
66- curl_setopt ($ ch , CURLOPT_HTTPPROXYTUNNEL , true );
71+ curl_setopt ($ ch , CURLOPT_HTTPPROXYTUNNEL , $ isHttps ); /* Enable HTTP tunneling only for HTTPS to prevent CONNECT method on port 80. */
6772 curl_setopt ($ ch , CURLOPT_PROXY , $ proxyUrl ); /* Url is a proxy. */
6873 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true ); /* Return transfer as a string. */
6974
You can’t perform that action at this time.
0 commit comments