Since version 0.97 beta, PAW Server supports binary Web Sockets. Before that only text base Web Sockets were supported.
Binary Web Sockets have the benefit (as the name implies) that binary Blobs (Binary Large Objects) can be exchanged. That offers the possibility to exchange binary data. This blog post shows how to use binary Web Sockets to build a simple (multi-) media chat client by using these new capabilities.
Bellow is a screenshot of the new chat window which also allows to drag and drop (media) files to send them to connected clients. There are two drop areas, the button titled Drop / Select and the message output area. In addition files can be selected by pressing the Drop / Select button.
The setup is almost identical to the one described inside the former post Chatting with Web Sockets.
So to make sure Web Sockets are setup correctly follow the following steps from the post Chatting with Web Sockets:
- Configuring the Web Socket Handler
- Web Socket Config File
- The BeanShell Script
After the configuration is finished, the only thing left is to extract the ZIP file into a folder (e.g. chat2) of your choice inside the [PAW_HOME]/html folder (usually /sdcard/paw) and to call that page from a browser.
You can now try to connect to the web page (e.g. http://<ip>:8080/chat2/) with multiple browsers and see if the chat is working.
Have fun and merry Xmas :)
ZIP file: web_sockets_chat2.zip