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

How to Integrate Tor with WKWebView #87

Open
tobitech opened this issue Oct 17, 2023 · 3 comments
Open

How to Integrate Tor with WKWebView #87

tobitech opened this issue Oct 17, 2023 · 3 comments

Comments

@tobitech
Copy link

Hello, can someone please point me to documentation/code samples or reference on how to route all WKWebView requests through Tor Network.
I have experience building iOS Applications but I'm new to Tor network and framework.

The example provided in the ReadMe file shows how to integrate Tor with URLSession but I'm not sure how to integrate Tor with WKWebView requests.

@tladesignz
Copy link
Member

You are sooo lucky! Fresh out of the oven: https://github.com/OnionBrowser/OnionBrowser/blob/3.X/OnionBrowser/Browsing/Tab.swift#L479-L490

@tobitech
Copy link
Author

@tladesignz Thanks for sharing. Seems this is only supported on iOS 17. I'm targeting iOS 14.

@tladesignz
Copy link
Member

You've got 3 options:

  1. Target iOS 17, use the provided proxy interface.

Be aware: Audio/video won't be tunnelled through Tor, because that is traditionally handled with another library in its own process.
Users will also leak their real IP address through WebRTC. (Check browserleaks.com)

  1. Use a Network Extension (aka. "VPN" in the UI) like Orbot does.

This will route the whole device traffic, unless you find a means to tag your packets. (Which I couldn't think of, because you don't have access to the WKWebView networking stack.)

On top, going into Network Extensions will open a whole new world of pain for you: Shitty debugging possibilities, 50 MB memory limit (only from iOS 15, iOS 14 has 15 MB, which surely isn't enough to run Tor), an awful process to get this pushed past Apple etc, etc.

  1. Find an awesome, new, clever, undocumented and unhindered (by Apple's code analysis) way to do it.

(Please, please tell me, when you found that!)

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