A complete chat system that runs in the browser. Server side Perl websocket server fronted by apache2 proxy. Client side jQuery. With file uploads. Requires no user account or registration. Uses no cookies. Public and private one to one and one to many messages are possible, with auto URL linking, and image testing and embedding.
- Perl Modules:
- jQuery 1.11.3+
- jquery.mobile-1.4.5+
- freezeframe.js
- A modern browser that supports WebSockets
- Apache 2.x
- see wss/example.pwsc.conf comments for everything you need to know to configure both the websocket server and the upload.cgi script
- copy example.pwsc.conf to pwsc.conf before editing
- see example.pwsc.apache2.conf for everything you need to know to set up your apache https virtual host
- copy example.pwsc.apache2.conf to your
/etc/apache2/sites-available
and create a symbolic link to thesites-enabled
dir then restart apache (paths may differ on non-ubuntu servers) - the port that the websocket server listens on MUST be the same port that your Apache Proxy BalancerMember is set to
You will need to start up the websocket_server_pwsc process:
Usage:
websocket_server_pwsc start
websocket_server_pwsc stop
websocket_server_pwsc run
websocket_server_pwsc status (this will start a live log file tail which you can escape from using CRTL-C)
It's likely a good idea to use some linux server init script to keep it running and monitored as well. You should also have some monitoring for disk usage in your uploads dir or you might get your server filled up.
It works in Chrome on MacOS and on Android Chrome without issues. Should work pretty much everywhere else too. The CSS layout will adapt to screen size automatically. Mobile optimized.
These are taken from a fully functioning live URL:
It is possible to have multiple websocket server processes listening on different ports all put into a proxy balancer pool, however this would require that some interprocess communication happens between them otherwise messages would get lost. If you want to know how to do this, please ask. I've done this on other systems using almost the same code.
- Peer to Peer WebRTC video and audio calling between 2 users, coordinated via websocket messages. Once the WebRTC connection is established there will be no server interaction
- theme changes
- rooms should be dynamically created instead of fixed
- private rooms
- audio/video file uploads and embedded players
- social sharing cards embedded
- message bubbles