Skip to content

Simple WebSocket server class to manage rooms and handle json messages.

Notifications You must be signed in to change notification settings

happy-monkey/websocket-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

websocket-server

Install

composer require happy-monkey/websocket-server

Messages format

{
    "action": "actionName",
    "data": mixed | null,
    "room": "room_id" | null
}

If a message is received, server will look for a method called onActionName and execute it. Callback will take 3 arguments :

  • Client object of sender
  • Data of message
  • Room object if a room with room_id if exists

Angular WebSocket client service

See https://www.npmjs.com/package/@happymonkey/websocket-client

About

Simple WebSocket server class to manage rooms and handle json messages.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages