Setup Proxy Dynamically (CORS Problem)


#1

Hello everyone,

I’ve been looking on the web and all over this forum to find some help but I couldn’t. I hope some bright minds here will be able to point me in the right direction.

Currently, my app is working with a static proxyUrl in the ionic.project. A single URL pointing to a single server. What I need to do is to launch the app without any static proxyUrl and add one after a certain action from the user.

In fact, there will be many servers, and many Urls. The user will scan a QR code to get the right information to a specific server related to his own project. This information will be the server’s API url. Then I’ll have to dynamically setup the proxy with that url, so the application is talking to the right server.

I don’t even know if it’s possible to setup a proxy ‘on the fly’ once the app is started.

Please, I need some advice,

Thank you !