Krumelur
Krumelur

Reputation: 32547

NSURLConnection, using proxy server

I want to POST using an NSURLConnection, using a SOCKS proxy along the way.

From what I've read, NSURLConnection does support SOCKS and HTTP proxies. The question is, where do I configure it? I couldn't find any suitable method on e.g. NSURLRequest for configuring which proxy server to use.

If this is a limitation, does anyone know of a good replacement that does support SOCKS?

Upvotes: 1

Views: 2156

Answers (1)

Tommy
Tommy

Reputation: 100632

Though I've never used it myself, from reading around the topic I think you need to use an NSOutputStream rather than an NSURLConnection, which is toll-free bridged with CFWriteStream. On that you can use CFWriteStreamSetProperty with the kCFStreamPropertySOCKSProxy key and a dictionary with corresponding entries for the various keys defined here.

Upvotes: 1

Related Questions