All Projects → palkan → Wsdirector

palkan / Wsdirector

Licence: mit
All the world's a server, and all the men and women merely clients

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Wsdirector

Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+5894.83%)
Mutual labels:  cli, websockets
Claws
Awesome WebSocket CLient - an interactive command line client for testing websocket servers
Stars: ✭ 187 (+222.41%)
Mutual labels:  cli, websockets
Acli
Action Cable command-line client
Stars: ✭ 169 (+191.38%)
Mutual labels:  cli, websockets
Streamhut
Stream your terminal to web without installing anything 🌐
Stars: ✭ 676 (+1065.52%)
Mutual labels:  cli, websockets
Dvm
Fast and simple Deno runtime version manager written in OCaml
Stars: ✭ 58 (+0%)
Mutual labels:  cli
Bashupload
PHP/JavaScript file upload web app to upload files from command line & browser, and download them elsewhere. Frequently used to upload/download files on servers. Hosted version is available at bashupload.com.
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli
Bangjago Android Emulator
simple android emulator cli for mobile development
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli
Go Websocket
🔈 Deprecated. Use https://github.com/kataras/neffos instead
Stars: ✭ 55 (-5.17%)
Mutual labels:  websockets
Inlets
Cloud Native Tunnel, now inlets PRO
Stars: ✭ 8,420 (+14417.24%)
Mutual labels:  websockets
Taskbook
Tasks, boards & notes for the command-line habitat
Stars: ✭ 8,326 (+14255.17%)
Mutual labels:  cli
Gemfury
Gemfury CLI and API client
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli
Nord Konsole
An arctic, north-bluish clean and elegant Konsole color scheme.
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli
Pizza Cli
🍕 Order a pizza in a CLI app (just for fun!)
Stars: ✭ 58 (+0%)
Mutual labels:  cli
Easyv2
Visit v2ex in terminal
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli
Spotify Tui
Spotify for the terminal written in Rust 🚀
Stars: ✭ 11,061 (+18970.69%)
Mutual labels:  cli
Batchimageprocessor
A Mass Image Processing tool for Windows
Stars: ✭ 55 (-5.17%)
Mutual labels:  cli
Steamwebpipes
🚀 Pushes Steam changelists to WebSocket clients
Stars: ✭ 56 (-3.45%)
Mutual labels:  websockets
Shinobi
☮️ 🇵🇸 Shinobi CE - The Free Open Source CCTV platform written in Node.JS (Camera Recorder - Security Surveillance Software - Restreamer
Stars: ✭ 1,099 (+1794.83%)
Mutual labels:  websockets
Mkcli
Markdown command line interface definition
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli
Movtogif Cli
📺 Convert mov/mp4 to high-quality animated gifs
Stars: ✭ 56 (-3.45%)
Mutual labels:  cli

Cult Of Martians Gem Version Build

WebSocket Director

Command line tool for testing websocket servers using scenarios.

Suitable for testing any websocket server implementation, like Action Cable, Websocket Eventmachine Server, Litecable and so on.

Installation

gem install wsdirector-cli

Usage

Create YAML file with simple testing script:

  # script.yml
  - receive: "Welcome" # expect to receive message
  - send:
      data: "send message" # send message, all messages in data will be parse to json
  - receive:
      data: "receive message" # expect to receive json message

and run it with this command:

wsdirector script.yml ws://websocket.server:9876/ws

#=> 1 clients, 0 failures

You can create more complex scenarios with multiple client groups:

  # script.yml
  - client: # first clients group
      name: "publisher" # optional group name
      multiplier: ":scale" # :scale take number from -s param, and run :scale number of clients in this group
      actions:
        - receive:
            data: "Welcome"
        - wait_all # makes all clients in all groups wait untill every client get this point (global barrier)
        - send:
            data: "test message"
  - client:
      name: "listeners"
      multiplier: ":scale * 2"
      actions:
        - receive:
            data: "Welcome"
        - wait_all
        - receive:
            multiplier: ":scale" # you can use multiplier with any action
            data: "test message"

Run with scale factor:

wsdirector script.yml ws://websocket.server:9876 -s 10

#=> Group publisher: 10 clients, 0 failures
#=> Group listeners: 20 clients, 0 failures

The simpliest scenario is just checking that socket is succesfully connected:

- client:
    name: connection check
  # no actions

Protocols

WSDirector uses protocols to handle different actions. Currently, we support "base" protocol (with send, receive, wait_all actions) and "action_cable" protocol, which extends "base" with subscribe and perform actions.

ActionCable Example

Channel code:

class ChatChannel < ApplicationCable::Channel
  def subscribed
    stream_from "chat_test"
  end

  def echo(data)
    transmit data
  end

  def broadcast(data)
    ActionCable.server.broadcast "chat_test", data
  end
end

Scenario:

- client:
    multiplier: ":scale"
    name: "publisher"
    protocol: "action_cable"
    actions:
      - subscribe:
          channel: "ChatChannel"
      - wait_all
      - perform:
          channel: "ChatChannel"
          action: "broadcast"
          data:
            text: "hello"
- client:
    name: "listener"
    protocol: "action_cable"
    actions:
      - subscribe:
          channel: "ChatChannel"
      - wait_all
      - receive:
          channel: "ChatChannel"
          data:
            text: "hello"

Future Ideas

  • Report timings (per-client and aggregates)

  • File-less scenarios (JSON-encoded?), e.g.

wsdirector -i '{"receive": "hello"}' localhost:9898/ws
  • Connection parameters (headers, query params, etc)

  • Testing frameworks integrations

  • Loading protocols dynamically

  • What else? Submit an issue!

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/palkan/wsdirector.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].