I currently have an app based inside of a WKWebView in ios swift. I was wondering if it is possible to route all of the outgoing connections from that webview through TOR. Ive seen projects like ICepa and Tor.framework but am a little clueless on how to use them for a web view.
All help is appreciated.
Thanks
A WKWebView object is a platform-native view that you use to incorporate web content seamlessly into your app's UI. A web view supports a full web-browsing experience, and presents HTML, CSS, and JavaScript content alongside your app's native views.
One major architectural difference between UIWebView and WKWebView is that the methods of WKWebView tend to be asynchronous, while the methods of UIWebView were synchronous. This difference requires code and architecture changes in your app.
WKWebView uses the Nitro JavaScript engine, also used by mobile Safari, which comes with significant performance improvements over UIWebView's older JavaScript engine.
You can't control how a WKWebView (or the newer Safari View Controller) accesses the internet; it always uses the system WAN connection.
One approach might be to build a VPN service that 1) is available to the operating system and can easily be switched on 2) routes the VPN tunnel through TOR instead of a traditional VPN system. You could then use your web view as usual, knowing that the data will be routed through a virtual tunnel into TOR instead of using the regular internet connection.
I suggest you start here: https://developer.apple.com/documentation/networkextension/nevpnmanager
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With