HTML5 WebSocket
AMXJeff
Posts: 450
Hey All!
Playing with WebSockets, thought you all could use this! I made a WebSocket server. Use only Chrome (Mac, Windows), IE10 (Windows), Safari (Mac 6.0.2), iOS (Chrome, Safari), Firefox (12) web browsers if you expect it to work. Would need to implement MD5 with Safari windows (5.1.7), so I wont.
This is provided as is with no support. Modify, delete, don't use what ever you like!
So create your own HTML5 Web User Interfaces! Fast two way communication.
Does Push, Release, On, Off, Level (to,from), commands (to,from), strings (to,from).
Make sure you update the IP address in the test.html file to that of your controller.
Enjoy!
Jeff
Playing with WebSockets, thought you all could use this! I made a WebSocket server. Use only Chrome (Mac, Windows), IE10 (Windows), Safari (Mac 6.0.2), iOS (Chrome, Safari), Firefox (12) web browsers if you expect it to work. Would need to implement MD5 with Safari windows (5.1.7), so I wont.
This is provided as is with no support. Modify, delete, don't use what ever you like!
So create your own HTML5 Web User Interfaces! Fast two way communication.
Does Push, Release, On, Off, Level (to,from), commands (to,from), strings (to,from).
Make sure you update the IP address in the test.html file to that of your controller.
Enjoy!
Jeff
0
Comments
Hey I have been updating this, the HTML pages are still not pretty but hey that is your job.
For some of you that have been looking for a SHA1 hashing routine I had to create one for the server.
Please use this version if you downloaded it before.
Enjoy!
Jeff
Source has been moved! Go to Link below...
http://code.google.com/p/amx-websocket-server
Thanks for the advise, not sure how much I am going to be updating this, because I am moving to my duet version. But good suggestion none the less. This was originally just for testing my ideas... Find source here!
http://code.google.com/p/amx-websocket-server/
Do you have any plans to release the Duet version as well?
The duet version is for my customers, so sorry no. However the NetLinx version should suffice. Enjoy!
Thanks, Jeff! We were working on an implementation of this earlier when we ran across yours. Do you happen to know if there's any way to update/configure the Jetty web server? Currently we write a file to the web server when the socket connections are maxed out so the next client that tries to connect knows what the issue is. It would be great to enable the server to send the access control allow origin header so client files not served from the local web server can do a cross domain request to check for that file.
Well... I think I follow what your asking... There is a way to write servlets in duet that allows you to have access to the web server. However you need a secret license key to register the servlet with the service. AMX won't be releasing that any time soon.
You running into the 200 connection limit? I normally allow much less, when the connection get just above my imposed limit, I send a message to the client and then disconnect them.
Assuming you're still in v3, just create an instance of Jetty on an open port in your module. Then you can add your servlets. To solve the above issue, do a...
response.setHeader("Access-Control-Allow-Origin", some_host);
Thanks for posting this. This will come in very handy