Before talk I just made it by Flash. When on server side (https) put special file (crossdomain.xml), and Flash part on http server. Of course they are different domain in https and http server parts. It isn't hard because I owner both servers. But I wonna make it without Flash. By JS/XHR. Or by PHP/curl? Is it possible? Thanx!
Asked
Active
Viewed 1,040 times
0
-
Mixed HTTP / HTTPS requests tend to get blocked by browsers (no matter what CORS headers might be included). See [this question](http://stackoverflow.com/questions/5647461/how-do-i-send-a-post-request-with-php) for PHP. – Quentin May 24 '16 at 15:36
-
Are you shure there isn't way send request https -> http or http -> https ? – user5555232 May 27 '16 at 17:34
1 Answers
-1
CORS is configured differently in each web server, not in any web framework. Here are the instructions to enable it on Apache:
http://enable-cors.org/server_apache.html
Here in IIS:
http://enable-cors.org/server_iis7.html
Once the server is configured to allow CORS, you can begin to make your CORS ajax requests using JQuery or any other technology you prefer.

Oscar
- 13,594
- 8
- 47
- 75
-
-
@Quentin If the browser receives the appropriate headers there shouldn't be any problems. I had used extensively Chrome and IE with this without problems. – Oscar May 24 '16 at 15:41
-
1See [this live demo](https://jsfiddle.net/gtg7o68u/) which causes Chrome to output *Mixed Content: The page at 'https://jsfiddle.net/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://jsonplaceholder.typicode.com/posts/1'. This request has been blocked; the content must be served over HTTPS.* – Quentin May 24 '16 at 15:49
-
https://www.evernote.com/l/AAMBDdA9W9FBu5X3P4ti5_v_9VhLA80G0Yg — The request gets blocked before it even gets sent so CORS can't help (because that depends on the response granting permission). – Quentin May 24 '16 at 15:50
-
@Quentin I'm not talking about mixed content, you're right, I didn't understood that part of the question – Oscar May 24 '16 at 16:29