1.0.0 • Published 5 years ago

websocket-mock-server v1.0.0

Weekly downloads
243
License
ISC
Repository
github
Last release
5 years ago

A simple and configurable mock server with UI console for websocket, with which you can either send message manually or make rules to get matched response. Err... It's hard to summarize, Let's take a look!

Installation

npm package

npm install websocket-mock-server

github repo

git clone https://github.com/EmiyaYang/websocket-mock-server.git
npm install
npm run build
npm run test

Configuration

package.json

{
  "script": {
    "mock": "wsmock -c CONFIG_PATH"
  }
}

The following config.js will be used and watched as default config when no CONFIG_PATH is provided.

module.exports = {
  port: 4040,
  // a function exported to handle specific input and return output which will be sending later.
  rule: function (input) {}
  // set the delay time before sending auto message 
  autoMsgTimeout: 1000,
};

Run

Terminal

npm run mock

preview

The frontend provide a chatroom-like way for you to send WebSocket message to server, which will be broadcast to other clients.

TODO

  • feat: Serial message flow test;
1.0.0

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago