> On Dec 21, 2015, at 10:28 AM, Daryle Walker <dary...@mac.com> wrote:
> 
> Can a new URL protocol class use an XPC to sandbox the Internet work?

It should be able to. I don’t know how XPC works, but ten years ago I 
implemented an NSURLProtocol that used Mach messages to call a background agent 
process that generated the HTTP responses. (This was the implementation of the 
‘feed:' protocol in Safari in 10.5-10.7; the RSS UI was actually a web app 
served by the PubSubAgent process.)

All you need to do is create some sort of session identifier for each instance 
of your protocol subclass (i.e. by incrementing a global counter) and send that 
ID along with messages to the XPC process. That process can then include the 
same identifiers in its replies, so you can route them to the appropriate 
protocol instance.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to