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

Feature CORS Proxy #227

Open
troyanskiy opened this issue Nov 28, 2018 · 8 comments
Open

Feature CORS Proxy #227

troyanskiy opened this issue Nov 28, 2018 · 8 comments

Comments

@troyanskiy
Copy link
Contributor

Hello all.

I have implemented something like proxy for iOS wkwebview.
It works exactly the same way as ionic server with proxies does.

I need your help in order to test the feature.

Installation:

  1. ionic cordova plugin rm cordova-plugin-ionic-webview
  2. ionic cordova plugin add https://github.com/troyanskiy/cordova-plugin-ionic-webview.git

Add proxies list:
That need to be added into the config.xml

<wkproxy path="/api/" proxyUrl="https://www.domain.com/api/" />

For future releases and if people will need that i'm planing also implement ssl pinning on the proxy requests, add capacitor support (will need to check that) and maybe something else.

If you will find any bug related to the proxy feel free to open an issue here https://github.com/troyanskiy/cordova-plugin-ionic-webview/issues

Thanks!

@ghenry22
Copy link
Contributor

Interesting, can you ignore certificate errors if the proxyUrl uses a self signed certificate?

As Android ALSO now uses a built in webserver could a similar approach be implemented for Android? Otherwise we will end up with diverging code for different platforms.

@troyanskiy
Copy link
Contributor Author

Hello @ghenry22
I have plans to implement 3 ssl modes like it's done for plugin https://github.com/silkimen/cordova-plugin-advanced-http

  • default: default SSL cert handling using system's CA certs
  • nocheck: disable SSL cert checking, trusting all certs
  • pinned: trust only provided certs

@ghenry22
Copy link
Contributor

@troyanskiy that would be very interesting to me, one of my apps is a client for self hosted media server which uses a self signed certificate, used to be able to work around it with uiwebview with the certificate plugin but have been stuck with irritated users since wkwebview as I couldn't find a way to allow the app to connect even though this is a very valid usecase.

@troyanskiy
Copy link
Contributor Author

troyanskiy commented Nov 29, 2018

@ghenry22 I've just implemented ssl pining feature for the proxy
Please check docs in the README file on my fork https://github.com/troyanskiy/cordova-plugin-ionic-webview#proxy-ssl-pining

To update plugin:

  1. ionic cordova plugin rm cordova-plugin-ionic-webview
  2. ionic cordova plugin add https://github.com/troyanskiy/cordova-plugin-ionic-webview.git

@troyanskiy
Copy link
Contributor Author

Hello @mlynch
What do you think about that feature?

@troyanskiy
Copy link
Contributor Author

I have added one more thing to clear cookies on app start. Add an attribute with value clearCookies="yes" to wkproxy

@troyanskiy
Copy link
Contributor Author

troyanskiy commented Dec 5, 2018

I have added one more thing is a possibility to check SSL in the chain in order to check your intermediate certificate.
Add an attribute with value sslCheckChain="yes" to wkproxy

@NiklasMerz
Copy link
Contributor

This PR does this to some degree for iOS: #448

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

3 participants