Skip to main content
Ben Nadel at NCDevCon 2011 (Raleigh, NC) with: Garrett Johnson
Ben Nadel at NCDevCon 2011 (Raleigh, NC) with: Garrett Johnson ( @gjohnson391 )

Pusher.cfc - A ColdFusion Wrapper For v1.12 REST API

By on

Yesterday, I launched a project - Crypto.cfc - for generating Hashed Message Authentication Codes (Hmac) in ColdFusion. As a follow-up, I wanted to quickly launch an updated Pusher.cfc ColdFusion component, which makes use of Crypto.cfc's hmacSha256() method when communicating with the REST API. Additionally, this Pusher.cfc update also has methods for subscribing to both "private" and "presence" channels - a new feature of the v1.12 API.

Project: View Pusher.cfc on GitHub.

Right now, Crypto.cfc is a dependency of Pusher.cfc. In ColdFusion 10, however, we have the hmac() function, which make generating Hashed Message Authentication Codes (Hmac) very easy. I plan to create a ColdFusion10 branch which removes the Crypto.cfc dependency.

Reader Comments


New to pusher... installed the latest code and am getting an error on the examples/all_features/index.cfm page.

I updated application.cfc with my pusher id, key and secret.

Any ideas?


- Brian

Invalid CFML construct found on line 186 at column 34.
ColdFusion was looking at the following text:


The CFML compiler was processing:

A cfset tag beginning on line 186, column 18.

The error occurred in C:\Apache2\htdocs\aa_auctioneer\pusher\examples\all_features\index.cfm: line 186

184 :
185 : <!--- Create a PRIVATE message. --->
186 : <cfset message = {
187 : "text" = "Ah, Push it! Push it real good!"
188 : } />


I am on a coldfusion 8 server. I think I need to change the application.cfc file component stucture... correct? anything else I need to to to dumb it down for CF8?




Let me see if I can create a "coldfusion8" branch tonight after work. There's probably a good amount that needs to be changed. But, I don't think it will take too long.



I added a "coldfusion8" branch to the GitHub repository. I basically converted everything over to a tag-based syntax and fixed the incompatibility between struct-literal notations across ColdFusion versions.

NOTE: I didn't do any further testing than making sure the demo worked :)



I also created a "coldfusion10" branch for a ColdFusion 10 compatible version which removed the Crypto.cfc vendor dependency. Since ColdFusion 10 has native hmac() functions, it was easy to replace.