Support keepalive PING messages on the socket

This commit is contained in:
Gabe Kangas
2020-06-14 16:53:25 -07:00
parent a3c3276a48
commit a9662e7c1e
6 changed files with 92 additions and 32 deletions
+6
View File
@@ -1,9 +1,15 @@
const SocketMessageTypes = {
CHAT: "CHAT",
PING: "PING"
}
class Message {
constructor(model) {
this.author = model.author;
this.body = model.body;
this.image = model.image || "https://robohash.org/" + model.author;
this.id = model.id;
this.type = model.type;
}
addNewlines(str) {