Simple chat server on port 7000
An Erlang/OTP 22 application
Rebar3 project
By rebar3 shell
rebar3 shell
By rebar3 release
rebar3 release
./_build/default/rel/chat_server/bin/chat_server foreground
Telnet can be used to chat with the server
Below the available commands (I hope they are self explicative)
<<user,setname>>{username}
<<user,whoami>>
<<user,list>>
<<msg,{username}>>{textmsg}
<<room,list>>
<<room,create>>{roomname}
<<room,delete>>{roomname}
<<room,userlist>>{roomname}
<<room,join>>{roomname}
<<room,leave>>{roomname}
<<room,msg,{roomname}>>{textmsg}
<<room,belong>>
regex for name user / room: [a-zA-Z0-9]{3,}
Note: as soon as you connect to the server, you have to setname, otherwise the all other commands will be forbidden
Chat responses:
if the command sent if not present in the list, server responds with the same text sent;
if the command is correct, the answer is "ok" for PUT / DELETE / UPDATE request (ex <<user,setname>>{name}), otherwise arbitrary data for GET request (ex <<user,list>>)