3.0.3 • Published 4 years ago

websocket-broadcast v3.0.3

Weekly downloads
24
License
MIT
Repository
github
Last release
4 years ago

websocket-broadcast

Broadcasts received messages over websockets.

Install

npm install -g websocket-broadcast

How it works

It opens a websocket connection on port 3333. Clients connected to this server can broadcast messages between them. The client who sends a message doesn't receive it back, it's sent to the other clients only.

Client IDs

After each clients connects it will get a UUID V1 from websocket-broadcast. Useful if you need to identify your clients with a unique ID.

UUID will be sent in a message with type uuid, something like this:

{type: 'uuid', data: 'ed8ef0b0-35ff-11e7-8de4-6bd9049b7aa7'}

When a client is disconnected a message will be sent as well:

{type: 'disconnect', message: 'cya'}

You can disable ID generation by setting the --noid modifier:

websocket-broadcast --noid

Note that disconnection messages won't be sent when --noid is set.

Customize port

You can set a custom port by using the -p param:

websocket-broadcast -p 8080

SSL support

If you need a secure connection (wss) simply pass your credential and key to use them:

websocket-broadcast --cert /path/to/cert.pem --key path/to/key.pem

Logging

By default it will log every received message.

If you want to turn off logging you can use the --nolog:

websocket-broadcast --nolog

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago