Need to load http js and css over https - getting mix_content error

Viewed 363

I am trying to load an http website in an iframe in a https website. I know it will give me mixed_content error for js and css, so to resolve the mixed_content I am using proxy like below :

$url = "http://www.myweb.com";
$PROXY_HOST = "47.52.24.117"; // Proxy server address
$PROXY_PORT = "80";    // Proxy server port
$PROXY_USER = "";    // Username
$PROXY_PASS = "";   // Password
// Username and Password are required only if your proxy server needs basic authentication

$auth = base64_encode("$PROXY_USER:$PROXY_PASS");
stream_context_set_default(
 array(
  'http' => array(
    'method'=>"GET",
    'proxy' => "tcp://$PROXY_HOST:$PROXY_PORT",
    'request_fulluri' => true,
    'header' => "Proxy-Authorization: Basic $auth"
   // Remove the 'header' option if proxy authentication is not required
  )
 )
);
$res = file_get_contents($url);
echo $res;

But I am still getting mixed_content error for js and css. (Images and html content are loading fine under https).

1 Answers
Related