0

For local development on Windows, I'm serving an HTTPS back-end with client certificate authentication on Apache Tomcat at https://localhost:8443/api, and an HTTP front-end at http://localhost:3000/ on Node (Koa).

How can I connect these two for local development?

I've tried using koa-proxy and http-proxy to proxy the HTTPS API and request client certificates, but this hasn't worked. Now I'm considering if there's a way to proxy the HTTPS front-end to https://localhost:8443/.

1 Answers1

0

All front end requests are dealt with by node. U need a node module to pass all requests with /imanapirequest in the url to your backend.

The npm module connect-mod-rewrite is your friend. It syntax is similar to Apache syntax.

Your JavaScript when making a request should look like http.get('/imanapirequest/path') ... This request will then be rewritten by the rewrite module and handled by Apache. Job done.

Edit .. Just reread question and I see u need ssl. Not sure how well this works over ssl but give it a go.

user229044
  • 232,980
  • 40
  • 330
  • 338
danday74
  • 52,471
  • 49
  • 232
  • 283