This question has already been answered:
- Sending from https to http ajax 4 replies
There is generally an opportunity to produce such a trick, if so, how?
Thank you very much.
This question has already been answered:
There is generally an opportunity to produce such a trick, if so, how?
Thank you very much.
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 .
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.
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.
Source: https://ru.stackoverflow.com/questions/549614/
All Articles