Skip to content
/ sqrtalk Public

A chatroom based on c++ and websocket

Notifications You must be signed in to change notification settings

ma-yuf/sqrtalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 

Repository files navigation

sqrtalk

A chatroom based on c++ and websocket

API Document

response

success

{
  "type":"e.g. login"
  "status":"success",
  "message":"e.g. Login successful.",
}

error

{
  "type":"e.g. command"
  "status":"error",
  "message":"e.g. User not found.",
}

login

{
  "type":"login",
  "username":"your_username",
  "password":"your_password"
}

message

{
  "type":"message",
  "message":"hello"
}

receive message

{
  "type":"message",
  "username":"sender_username"
  "content":"hello",
}

private_message

{
  "type":"private_message",
  "to":"someone",
  "content":"hello"
}

receive private_message

{
  "type":"private_message",
  "from":"from_user",
  "to":"to_user",
  "content":"hello"
}

command

list

{
  "type":"command",
  "command":"/list"
}

receive list command

{
  "type":"user_list",
  "users":["user1","user2"]
}

admin command

kick

{
  "type":"command",
  "command":"/kick asd",
  "password":"your_password"
}

ban

{
  "type":"command",
  "command":"/ban asd",
  "password":"your_password"
}