I have just updated TooTallNate's Java-Websocket to be compliant with Draft 76 of the websocket spec. I have also updated my CFWebsocket to also be Draft 76 compliant. Finally I have put up my WebSocketChat. All the Repos can be found here
GitHub
The chat can be found here:
Chat
After you choose any user name you like click the Default room on the right to start chatting! Let me know what you think!
Friday, July 23, 2010
Wednesday, July 7, 2010
CFWebsocket
With the coldfusion community usually being on the cutting edge I was surprised to see that no one had implemented a websocket gateway for coldfusion (that I had seen). So I decided to build a custom coldfusion gateway so people can use coldfusion with websockets. My implementation is based off of TooTallNate's java websocket. http://github.com/TooTallNate/Java-WebSocket . You can access the jar witch contains the .class files and .java files here.
To Use
1. Download JAR, place in coldfusion classpath and restart server.
2. Download the config file, websocket.cfg, from here to serverroot/gateway/config/ . Optionally open file and change port the default is set to 88.
3. Add new gateway type the setup should look like this.
4. Create a new CFC like the one here.
5. Add new gateway instance that should look like
this.
Note: set the CFC path to the cfc you created in step 4.
Your gateway should now be setup for use. The CFEVENT struct in the gateway has a connection attribute which is the websocket connection object which has a .send() method to send data back to the client. In the onclientmessage function of the gateway there is also a message attribute in the CFEVENT struct that contains the message sent from the client. I should soon be uploading a chat application using this gateway to show how an application could be made. Also I have not load tested this or used it in a production environment so use at your own risk!
To Use
1. Download JAR, place in coldfusion classpath and restart server.
2. Download the config file, websocket.cfg, from here to serverroot/gateway/config/ . Optionally open file and change port the default is set to 88.
3. Add new gateway type the setup should look like this.
4. Create a new CFC like the one here.
5. Add new gateway instance that should look like
this.
Note: set the CFC path to the cfc you created in step 4.
Your gateway should now be setup for use. The CFEVENT struct in the gateway has a connection attribute which is the websocket connection object which has a .send() method to send data back to the client. In the onclientmessage function of the gateway there is also a message attribute in the CFEVENT struct that contains the message sent from the client. I should soon be uploading a chat application using this gateway to show how an application could be made. Also I have not load tested this or used it in a production environment so use at your own risk!
Labels:
coldfusion,
websocket
Subscribe to:
Posts (Atom)