A really simple proof of concept chatroom using PHP 7, Redis, and some vanilla Javascript.
- PHP 7
- Redis 2.8+ i guess
- the php-redis extension
- Nginx, apache, lighttpd, i don't care
- client-side only tested in chrome but it should be cool with any modern browser
Drop this folder of files somewhere on your server running the above requirements, and go to index.html
. That's all.
Put in your username and the name of the chatroom you wanna chat in.
Give a link to the place to other people and they can hop in too.
This isn't ready for any kind of production environment because:
- There's no username tracking so you could have ten people with the same username.
- This is 100% polling based so you could knock over your server if you have a ton of people connected.
- There's very little security to chatroom names, usernames, and messages beyond php
strip_tags()
- The chatroom name could be anything really. You could have lots of chatrooms running in multiple tabs.
The chatroom.php
script has a very simple API that I've documented in the SPEC.md file.
The amazing m5x7 font is by Daniel Linssen.