Skip to content

evodevo/chat_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Socket.io Chat Server Demo

Building and running a server

To build a project:

$ cd server
$ npm install
$ npm run build

To run a server:

$ cd server
$ npm start

or in debug mode:

$ DEBUG=server,chat npm start

To run tests:

$ cd server
$ npm test

To run a linter:

$ cd server
$ npm run tslint

Testing manually

To connect with wscat:

$ wscat -c 'wss://localhost:3000/socket.io/?EIO=3&transport=websocket' -n

Commands:

Command Description
42["join", {"channel": "room-1"}] Join a public channel named "room-1"
42["join", {"channel": "room-2", "password": "secret"}] Join a private channel named "room-2"
42["message", {"channel": "room-1", "content": "Hello everyone from client 1 to channel 1!"}] Send a message to a channel "room-1"
42["count", {"channel": "room-1"}] Get users count in channel "room-1"
42["leave", {"channel": "room-1"}] Leave a channel named "room-1"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors