iCepa/Tor.framework

[ios simulator] Unix socket path "[...]" is too long to fit.

gradientskier opened this issue · 1 comments

I tried to reproduce the example in the home page REAMDE.md on the ios simulator.

The code I am using

TORConfiguration *configuration = [TORConfiguration new];
configuration.cookieAuthentication = @(YES);
configuration.arguments = @[@"--ignore-missing-torrc"];
configuration.dataDirectory = [[NSURL URLWithString:NSHomeDirectory()] URLByAppendingPathComponent:@".tor"];

configuration.controlSocket = [configuration.dataDirectory URLByAppendingPathComponent:@"tor_control_port"];

TORThread *thread = [[TORThread alloc] initWithConfiguration:configuration];
[thread start];

The output

May 24 12:33:09.186 [notice] Configuration file "/Users/username/Library/Developer/CoreSimulator/Devices/B676E2CA-FCD2-41B1-ACC8-663A0CAF2F9C/data/Containers/Data/Application/372F817C-BD06-4341-A5B1-7F5093E12C71/.torrc" not present, using reasonable defaults.
May 24 12:33:09.190 [notice] Opening Socks listener on 127.0.0.1:9050
May 24 12:33:09.190 [notice] Opened Socks listener on 127.0.0.1:9050
May 24 12:33:09.190 [warn] Unix socket path '"/Users/username/Library/Developer/CoreSimulator/Devices/B676E2CA-FCD2-41B1-ACC8-663A0CAF2F9C/data/Containers/Data/Application/372F817C-BD06-4341-A5B1-7F5093E12C71/.tor/tor_control_port"' is too long to fit.
May 24 12:33:09.191 [notice] Closing partially-constructed Socks listener on 127.0.0.1:9050
May 24 12:33:09.191 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
May 24 12:33:09.191 [err] Reading config failed--see warnings above.

Is there any chance to use the Tor.framework on the iOs Simulator that has so long paths?

Yeah, no. Don‘t use file sockets. Use a network connection on the loopback device.

Check out Onion Browser‘s OnionManager class for a working example. Or iCepa.