Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate using a proxy in the native layer for Live Reload #3180

Open
imhoffd opened this issue Jun 30, 2020 · 1 comment
Open

Investigate using a proxy in the native layer for Live Reload #3180

imhoffd opened this issue Jun 30, 2020 · 1 comment

Comments

@imhoffd
Copy link
Contributor

imhoffd commented Jun 30, 2020

The Web View could always load the same address (keeping cookies, localStorage, etc. the same) if we could proxy the computer's dev server in the server on the device.

Today: Requests are made to both the computer and web view server for live reload.
computer ----------> web view
web view server ---> web view

Capacitor 3(?): All requests go through web view server.
computer ----> web view server ----> web view

Alternative to #2882, and solves many other issues (such as geolocation).

@KevinKelchen
Copy link

The scope of this feature appears to be for live reload, and I want to be careful and not get off-topic, but I wanted to ask regarding this feature: are there thoughts or plans on being able to configure this native layer proxy for the purpose of bypassing general CORS issues?

It might sound like a strange question, but here's our use case: Our app is required to talk to servers outside of our control where the WebView origins capacitor://localhost or http://localhost cannot be added to the CORS allow lists of those servers. Our app uses a third-party JS library that makes requests to those servers behind-the-scenes; there are no hooks for us to call those servers directly given the JS library's API. If that was the case and we could intervene and make those requests with our own code, we'd happily try using the native HTTP plugin but we can't. We have been relying on an external server proxy that's had some performance issues and we'd love to not use it if we can do something better in-app. 🙂

I can certainly open a Capacitor proposal and continue discussion there if the native layer proxy being discussed here is not planning to incorporate general CORS bypassing.

Thank you! 😀

Kevin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants