New Version of ColdFusion WebSocket Gateway

Today I finally got around to updating my cf-websocket-gateway project. This version is based on the Webbit WebSocket server, which is itself based on the Netty project. I made this change because the Java-Websocket server I was using was not being updated and Webbit is a very nice WebSocket server that supports the latest versions of the WebSocket specifications and thus works with the latest versions of Chrome, Safari, etc.

Of course, shortly after migrating to Webbit, Java-Websocket was updated to support the latest WebSocket specifications so if you would like to continue to use that server as the underlying engine for your gateway check out the java-websocket branch on Github.

I should note that the API has changed with this release. If you have existing listener CFCs that use the onClientOpen and onClientClose listener methods those should be renamed to simply onOpen and onClose. Once that change is made your existing listeners should work with version of the gateway. As always, please report any issues on the Github project page.

Comments
Brian Kalbfleisch's Gravatar Thank you for updating this gateway! This is the easiest solution I have found for websockets. By using separate jar files for the websocket interface, I was able to update the socket sever very easily for Chrome 16. I updated to the new netty-3.2.7.Final.jar and webbit-0.3.8.jar files to achieve this.

Is there a way to specify the specific IP address the websocket gateway can listen on? I know i can change the port, but I would like to have the gateway listen on a separate ip address so it can listen on port 80.

Thanks again for creating this gateway.
# Posted By Brian Kalbfleisch | 2/2/12 2:25 PM
Brian Kalbfleisch's Gravatar I figure out the ip address issue. Add another ip address to the box and make sure IIS is not using it with the netsh command. Set the gateway port to 80 and you are good to go.
# Posted By Brian Kalbfleisch | 2/2/12 4:02 PM
Nathan Mische's Gravatar You may want to talk to the Webbit team, but I don't think you can set the IP address. As for port 80, Rather than trying to run Webbit on a privileged port I think the preferred method is to do port forwarding. So Webbit would continue to run on 8080 or another unprivileged port and you would redirect 80 -> 8080.
# Posted By Nathan Mische | 2/2/12 4:21 PM
Nathan Mische's Gravatar How does Netty/Webbit know what IP address to bind to? I guess maybe it binds to the one that has port 80 free? Still, doesn't Java complain if you try to start the gateway on port 80?
# Posted By Nathan Mische | 2/2/12 4:25 PM
Brian Kalbfleisch's Gravatar It seems to bind to any ip address that is not currently bound on 80 (or whatever port you specify). I added a few more ip addresses to the server, and could connect to any of those ip's. The websocket still worked in chrome, but iOS 5 did not like it on 80, perhaps a domain origin issue. I am just trying to use a port that is open on most hospital firewalls for this project.

Again, I really appreciate the time you took to make this gateway. Here is a link to a news article on the project we developed using websockets as the communication between mobile devices.

http://rsna2011.rsna.org/DailyBulletin/index.cfm?p...
# Posted By Brian Kalbfleisch | 2/3/12 9:58 AM
Nathan Mische's Gravatar Brain, that looks like a cool project! I'm not that familiar with IIS, but can you set it up as a reverse-proxy to the Webbit server?
# Posted By Nathan Mische | 2/3/12 12:04 PM
Dany's Gravatar Does this work with wss? Are there any other server settings that need to be made to get this to work, other than adding the Gateway type and instance?
# Posted By Dany | 6/28/12 11:06 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.