guardianproject/Tor.framework

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Tor.framework

Carthage Compatible Travis CI

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 |

Requirements
Installation

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
Carthage

To integrate Tor into your Xcode project using Carthage, specify it in your Cartfile:

ub "iCepa/Tor.framework" "master"
Usage

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];
        ...
    }];
}];

License

Tor.framework is available under the MIT license. See the LICENSE file for more info.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.