+ 3
How to make an instant chat ?
What is the method to make an instant chat without keeping messages into a database ? So people connect for example at 12h and they are able to see all the message posted after 12h until that they leave the page
6 Answers
+ 11
you can congifure listeners with socket.io
the server can hold the messages for as long as it'a running
i'd suggest you experiment with socket.io and node.js and if you want to run a webserver you can host small apps on heroku
here's a small demo i did a while back
https://github.com/bureyburey/tictactoe-ng-express-socketio
hosted at heroku:
https://tictactoe-ng-express-socketio.herokuapp.com/#!/home
+ 7
research websockets
mainly socket.io
goodluck ;)
+ 4
I think you'll need the devices to bypass a server and connect directly, so you'll probably need some static ip addresses or someway of finding the ip of the devices before connection. It's quite advanced stuff and a bit beyond me. I'd stick with a database and server, it's much simpler.
Maybe someone else can suggest something better.
Any reason why you don't want to use a database?
+ 4
@Antoine, if you research ajax you'll see that you don't need to refresh the page when new messages appear. Good luck, mate.
+ 2
@Burey thanks
+ 1
Firstly thank you for your answer.
I can use a database but I don't want to keep all the messages. I can delete the messages if they are to old but I just wanted to know if there is a way to make this without creating new lines on sql database deleting lines...
An other question, for a chat we need to refresh the page everytime we get a new message, didn't it ? I just don't know why in php I can refresh the part with my chat not the entire webpage