This question has already been answered:

There is generally an opportunity to produce such a trick, if so, how?

Thank you very much.

Reported as a duplicate by Grundy , aleksandr barakin , Denis , user194374, Kromster July 29 ', at 8:42 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

2 answers 2

This trick can only be done through a proxy. For example, you will have a proxy Url on the seith. Directly in any way, browsers are all banned.

  • but how can it be done for example? there is a proxy - ikerya
  • It will be easier to write a method on the server that will accept a certain set of parameters, send these parameters to the url of interest to you (http | https), and return the data received from another server as a response to the client. - Petr Chalov

The opportunity is there. It is necessary to set the header Access-Control-Allow-Origin on the server side, which accepted ajax, which will allow cross-domain requests. PHP example:

 if (!empty($_SERVER['HTTP_ORIGIN'])){ $originExpl = explode('//', $_SERVER['HTTP_ORIGIN']); $domain = end($originExpl); if ($domain == $_SERVER['HTTP_HOST']){ header("Access-Control-Allow-Origin: ".$_SERVER['HTTP_ORIGIN']); } } 

To do this, https must be signed with a valid certificate, otherwise, if only ajax via https is in progress, the user will not be able to remove the security restriction.

  • Yes. we tried all this, but we need to send not an ordinary request, but a request from a secure site to an unsecured one. - ikerya