• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Implementing proxy support
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing proxy support


  • Subject: Re: Implementing proxy support
  • From: Daryle Walker <email@hidden>
  • Date: Thu, 17 Jul 2014 04:27:47 -0400

On Jul 15, 2014, at 2:10 AM, Jens Alfke <email@hidden> wrote:


On Jul 14, 2014, at 10:34 PM, Daryle Walker <email@hidden> wrote:

I’m in the middle.  It’s a NSURLProtocol subclass, which NSURLConnection/Session use to do their dirty work.  So I have to implement the “automatic" check and proxy setting following, probably involving CFStream or BSD sockets.  Hopefully not the latter, since I’m a newbie.

You can actually do the dirty work using NSURLConnection/Session. You just have to avoid infinite regress...

I don’t know which one(s) I need yet.  What proxy styles were the Networking authors envisioning for the entries in the control panel?

I imagine it supports all of them, since any missing support would lead to some enterprise IT department banning Macs because “they don’t work on our network”. :-p

Checking on another forum, this time about the protocol, the protocol doesn’t have direct proxy primitives, it just piggybacks on a HTTP 1.1 CONNECT command.  So I guess I send the command, check if the response has a success code, keeping a persistent connection (so my next steps can use the just-authorized link), then send my key string and wait for the proxied response.  I haven’t read the CONNECT spec yet; so is the second request/respond round a raw transaction, or do I wrap the request in another HTTP command (and get response as a HTTP response)?  I’m guessing that the CF/NS-Stream APIs support whichever way I’m supposed to do it, otherwise Apple’s own FTP and HTTP code couldn’t handle proxies.

If the second request/response round is not raw, then I can’t reuse the code I need for non-proxy transactions.

How am I supposed to test the subclass, proxy or not?  My guess so far is to make a quick web-browser app and hook my NSURLProtocol subclass to it, then enter an appropriate URL.  It’ll have to always return text/plain data at first so I can see what happens.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Implementing proxy support
      • From: Daryle Walker <email@hidden>
References: 
 >Implementing proxy support (From: Daryle Walker <email@hidden>)
 >Re: Implementing proxy support (From: Jens Alfke <email@hidden>)
 >Re: Implementing proxy support (From: Daryle Walker <email@hidden>)
 >Re: Implementing proxy support (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Using NSURLSession for uploading lots of prioritized files
  • Next by Date: Re: Implementing proxy support
  • Previous by thread: Re: Implementing proxy support
  • Next by thread: Re: Implementing proxy support
  • Index(es):
    • Date
    • Thread