pcrawfor/FayeObjC — pull request #12 by steveluscher (2013-02-22 07:55:06+00:00)
Title: FayeObjC should implement the Faye extension architecture

According to the [original architecture](http://faye.jcoglan.com/architecture.html), Faye extensions are filters that sit between the client and the transport. They should be allowed to examine, modify, and drop incoming and outgoing messages.

Here is an implementation that delegates the filtering to your FayeClientDelegate. The delegate may implement two methods:

- (void)fayeClientWillReceiveMessage:(NSDictionary *)messageDict
withCallback:(FayeClientMessageHandler)callback;
- (void)fayeClientWillSendMessage:(NSDictionary *)messageDict
withCallback:(FayeClientMessageHandler)callback;

These methods can have their way with the inbound/outbound message, and then pass it along by sending an NSDictionary to the continuation callback.

This is brilliant for doing things like stuffing authorization credentials into `ext` on every outgoing message, or sniffing the contents of a server acknowledgement to see if they packed any goodies along with the ack.

In my opinion, extensions are what set Faye apart. I would love to see them come to FayeObjC.