This is a web socket plugin for Mountebank.
Client sends a request message and server sends a response message
{
"predicates": [
{
"equals": {
"message": "foo"
}
}
],
"responses": [
{
"is": "bar"
}
]
}
Client sends a request (subscribe). Server starts streaming responses. Client can also unsubscribe.
{
"predicates": [
{
"equals": {
"message": "start_ticker"
}
}
],
"responses": [
{
"is": {
"__MB_CUSTOM_RESPONSE": {
"command": "start_stream",
"source": "random_price",
"interval": 1000,
"id": "price"
}
}
}
]
}
{
"predicates": [
{
"equals": {
"message": "stop_ticker"
}
}
],
"responses": [
{
"is": {
"__MB_CUSTOM_RESPONSE": {
"command": "stop_stream",
"id": "price"
}
}
}
]
}
Thanks to Max Ludwig. LDAP plugin implementation was a great help for me to get started.
This project is licensed under the MIT License - see the LICENSE file for details