Sign inSign up

jrosiek/websocket-mock-server

By jrosiek

•Updated about 1 year ago

Mock websocket server for load testing

Image
0

944

jrosiek/websocket-mock-server repository overview

⁠WebSocket Mock Server

Websocket mock server for load testing purposes.

This container was used to measure and optimize performance of client-side WebSocket implementations.

⁠Running

docker run jrosiek/websocket-mock-server:latest [-h HOST] [-p PORT]

# eg.
docker run --network=host jrosiek/websocket-mock-server:latest -h 0.0.0.0 -p 8765

⁠Usage

After connecting to the server, it will work as an echo server.

At any time you can send a special json message to change mode of operation of the server. Once mode is changed, it cannot be changed back to echo mode.

The message should be in the following format:

{
  "magic": "--wsm--",
  
  "mode": "emit" | "sink",
  
  // optional
  "kwargs": {
    ...
  }
}
⁠Emit mode

The server will emit the same message at a regular interval.

kwargs can contain the following keys:

  • msg - the message to emit (type: string; default: 256 bytes of unspecified data)
  • freq - the frequency of the message emission in (unit: 1/second; default: 1)
⁠Sink mode

The server will just ignore any messages sent to it.

No kwargs are supported in this mode.

Tag summary

Content type

Image

Digest

sha256:631122be1…

Size

48 MB

Last updated

about 1 year ago

docker pull jrosiek/websocket-mock-server