Re: Implementing proxy support
Re: Implementing proxy support
- Subject: Re: Implementing proxy support
- From: Daryle Walker <email@hidden>
- Date: Thu, 17 Jul 2014 04:48:33 -0400
On Jul 17, 2014, at 4:27 AM, Daryle Walker <email@hidden> wrote:
> 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.
Just inspected an open-source program with this need. The code for the raw request and response is preceded by an IF block, testing if there’s proxy settings, to send the CONNECT command. (There’s no string building; the author printfs the HTTP request block right to the stream and scanfs the response to look for the 200 and blow through the rest.) So reuse should be possible, just need to create the CFStream before calling the CFHTTP code so I can still use the CFStream after the HTTP stuff.
—
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