Name: Tor.framework
Owner: Guardian Project
Description: Tor framework for the iCepa project
Forked from: iCepa/Tor.framework
Created: 2017-11-02 14:19:30.0
Updated: 2017-11-02 14:19:32.0
Pushed: 2017-10-27 21:16:06.0
Homepage: null
Size: 115
Language: Objective-C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Tor.framework is the easiest way to embed Tor in your iOS application. The API is not stable yet, and subject to change.
Currently, the framework compiles in static versions of tor
, libevent
, openssl
, and liblzma
:
| | | |:——– | ——-:| | tor | 0.3.1.8 | | libevent | 2.1.8 | | OpenSSL | 1.1.0f | | liblzma | 5.2.3 |
autoconf
, automake
, libtool
and gettext
in your PATH
Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).
If you use brew
, make sure to install autoconf
, automake
, libtool
and gettext
:
install automake autoconf libtool gettext
To integrate Tor into your Xcode project using Carthage, specify it in your Cartfile
:
ub "iCepa/Tor.framework" "master"
Starting an instance of Tor involves using three classes: TORThread
, TORConfiguration
and TORController
.
Here is an example of integrating Tor with NSURLSession
:
onfiguration *configuration = [TORConfiguration new];
iguration.cookieAuthentication = @(YES);
iguration.dataDirectory = [NSURL URLWithString:NSTemporaryDirectory()];
iguration.controlSocket = [configuration.dataDirectory URLByAppendingPathComponent:@"control_port"];
iguration.arguments = @[@"--ignore-missing-torrc"];
hread *thread = [[TORThread alloc] initWithConfiguration:configuration];
ead start];
L *cookieURL = [configuration.dataDirectory URLByAppendingPathComponent:@"control_auth_cookie"];
ta *cookie = [NSData dataWithContentsOfURL:cookieURL];
ontroller *controller = [[TORController alloc] initWithSocketURL:configuration.controlSocket];
troller authenticateWithData:cookie completion:^(BOOL success, NSError *error) {
if (!success)
return;
[controller addObserverForCircuitEstablished:^(BOOL established) {
if (!established)
return;
[controller getSessionConfiguration:^(NSURLSessionConfiguration *configuration) {
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
...
}];
}];
Tor.framework is available under the MIT license. See the LICENSE
file for more info.