4

How to Connect SOCKS Proxy connection in iOS I am able to connect successfully SOCKS Proxy Server via Simulator, when using System network setting. I have tried ASIHTTPRequest but Falied. Here my sample ASIHTTPRequest code

NSURL *url = [NSURL URLWithString:@"my working URL in Browser"];

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setProxyHost:@"aa.bb.c.dd"];
[request setProxyUsername:@""];
[request setProxyPassword:@""];
[request setProxyPort:12345];
[request setDelegate:self];
[request startAsynchronous];

I want to connect and consume SOCKS Proxy connection & Web Service in my App on Device.Thanks in advance.

Anurag Dixit
  • 119
  • 2
  • 16

1 Answers1

1

proxychains might help you running the application in android using socks proxy. It is a c library and overloads connect() routine of glibc. So any application requesting tcp connection goes through it.

I run my applications using this. for example 'proxychains java someclass'.

varun
  • 20
  • 2
  • I am talking about iOS applicaiton not java... :( – Anurag Dixit Aug 28 '13 at 13:45
  • 1
    it will work as well for iOS applications. The important thing is all applications call connect function for creating sockets. – varun Aug 29 '13 at 01:29
  • @varun can you provide more information about this? I am using proxychains but don't know how apply it for whole system! – duong khang Oct 11 '17 at 07:46
  • Not sure if you are still looking to do this, but I have been doing some looking around for a solution for dart. Basically what varun is saying is that you need to override the connection method call and implement the socks calls. This could also be done via dependency injection for cross platform. I'm not posting the solution because mines different but for anyone doing this just build a custom network caller object, easy. – Aaron B Apr 28 '21 at 02:37