chat using websocket , just adding some function, this code was taken on github and just modified