Need to download http js and css via https - getting mix_content error

I am trying to upload an http site in an iframe on an https site. I know that this will give me a mixed_content error for js and css, so I use a proxy to solve the mixed_content problem, as shown 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 still get mixed_content error for js and css. (Images and html content load perfectly under https).

+4
source share
1 answer

This is basically a comment, but the space in the comment field is limited here.

-, , . MSIE , . MSIE, , Microsoft, .

" ", , , , URL. , -, mod_rewrite 404, , URL- - script/, ....

, CSS, , URL-, URL http://?

, , , / mimetype.

0

Source: https://habr.com/ru/post/1682855/


All Articles