Monday, 24 April 2017

Understand HTTP and HTTPS requests in my client side to server side

previously I ask some question about modify my HTTP to HTTPS. I did the example and my server https works fine, but my application does not work anymore.

Show me the error:

The localhost page isn't working.

localhost didn't send any data.

ERR_EMPTY_RESPONSE

My use case is:

My project consumer some API, and the API use xmlhttprequest to send requests to my server and my application works fine with Express HTTP in my server.

And, I'm very confused by the infrastructure behind my application. I need to integrate my application to Wordpress site(HTTPS) and the iframe does not work because my application use http protocol.

I need help with some questions.

  • I need to modify my Client to do HTTPS requests to my server open my project?
  • I need modify the HTTP to HTTPS in my server and change the http request in my client to https requests?
  • I need to use some server like jBoss, ngnix, or some other http server to handle static files + https and set your nodeJS as a reverse proxy?

I see this post. In this case, I will not be able to make request HTTPS because the API use a browser, and the browser will let scripts make HTTP requests via XHR only to sites in the same domain as that of the page that loaded the script. Node.js, however, will allow HTTP requests to any domain.

What I can do to solved this problem? I just need my application run with https. Maybe is a newbie question, but, in this case use I'm very confused.



via Sayuri Mizuguchi

No comments:

Post a Comment