Skip to content

Instantly share code, notes, and snippets.

@belison
Created August 13, 2012 19:52
Show Gist options
  • Save belison/3343626 to your computer and use it in GitHub Desktop.
Save belison/3343626 to your computer and use it in GitHub Desktop.
Figure 5: Updated JS connection with auth
onFayeConnect: function (config) {
var user = this.get('user');
this.fayeClient.addExtension({
outgoing: function (message , callback) {
message.ext = {authToken: config.socket_auth_token , timestamp: config.socket_auth_timestamp};
callback(message);
}
});
his.fayeUserSubscription = this.fayeClient.subscribe('/' + user.get('id') + '/**' , this.onFayeEvent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment