All Projects → thehowl → Claws

thehowl / Claws

Licence: mit
Awesome WebSocket CLient - an interactive command line client for testing websocket servers

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Claws

Php Wss
Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
Stars: ✭ 117 (-37.43%)
Mutual labels:  websocket, websockets, websocket-client
Bolt Js
A framework to build Slack apps using JavaScript
Stars: ✭ 1,971 (+954.01%)
Mutual labels:  websocket, websockets, websocket-client
Node Slack Sdk
Slack Developer Kit for Node.js
Stars: ✭ 2,988 (+1497.86%)
Mutual labels:  websocket, websockets, websocket-client
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (+1.6%)
Mutual labels:  websocket, websockets, websocket-client
Gun
HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.
Stars: ✭ 710 (+279.68%)
Mutual labels:  websocket, websockets, websocket-client
Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+1759.36%)
Mutual labels:  cli, websockets, websocket-client
Websocket Client
🔧 .NET/C# websocket client library
Stars: ✭ 297 (+58.82%)
Mutual labels:  websocket, websockets, websocket-client
Websocket Client
WebSocket client for Python
Stars: ✭ 2,810 (+1402.67%)
Mutual labels:  websocket, websockets, websocket-client
Java Slack Sdk
Slack Developer Kit (including Bolt for Java) for any JVM language
Stars: ✭ 393 (+110.16%)
Mutual labels:  websocket, websockets, websocket-client
Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+1891.44%)
Mutual labels:  websocket, websockets, websocket-client
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+1633.16%)
Mutual labels:  websocket, websockets, websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (+354.55%)
Mutual labels:  websocket, websockets, websocket-client
Python Slack Sdk
Slack Developer Kit for Python
Stars: ✭ 3,307 (+1668.45%)
Mutual labels:  websocket, websockets, websocket-client
Starscream
Websockets in swift for iOS and OSX
Stars: ✭ 7,105 (+3699.47%)
Mutual labels:  websocket, websockets, websocket-client
Arduinowebsockets
arduinoWebSockets
Stars: ✭ 1,265 (+576.47%)
Mutual labels:  websocket, websockets, websocket-client
Httpcat
httpcat is a simple utility for constructing raw HTTP requests on the command line.
Stars: ✭ 109 (-41.71%)
Mutual labels:  cli, debugging
Simple Console
Add an elegant command-line interface to any page
Stars: ✭ 107 (-42.78%)
Mutual labels:  command-line-app, cli
Elixir cli spinners
Spinnig Animations for Command Line Applications
Stars: ✭ 117 (-37.43%)
Mutual labels:  command-line-app, cli
Webfluxtemplate
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.
Stars: ✭ 107 (-42.78%)
Mutual labels:  websocket, websockets
Tap Tap Adventure
Tap Tap Adventure is a massively online 2D MMORPG set in the medieval times with twists.
Stars: ✭ 123 (-34.22%)
Mutual labels:  websocket, websockets

claws demonstration

an Awesome WebSocket CLient

Claws

WebSockets have been on the rise for a long time, but there is no good command line client that allows to interface with websockets without having to deal with barebones interfaces. Claws aims to make testing websockets and interfacing with them easier and more pleasant.

Getting started

You can grab the latest release binary from the releases page. Simply download it, extract it, and run it in a command line.

If you have Go set up, it is easy as running the following command and making sure that $GOPATH/bin (or $GOBIN) is in your PATH. Generally, this should be pretty stable, but keep in mind that it builds on master, so it may break at any point.

go get -v -u howl.moe/claws

Usage

claws [wsURL]

wsURL is an optional websocket URL to connect to once the UI has been initialised.

Once the UI has been initialised, you will be by default in "normal mode": green box with nothing in it. This means you are composing a message to send to the server through the websocket. By pressing Esc, followed by a letter, you can do a variety of actions explained in the following table.

Letter Meaning
i Go to insert mode (also works by pressing the Ins key).
c Create a new WebSocket connection. Will prompt for an URL. If nothing is passed, previous WebSocket URL will be used.
q Close current WebSocket connection.

Quitting is done by pressing Ctrl-C. In previous version, you could press Esc twice to exit, but we decided to remove that because some vim aficionados (myself included) may find themselves panickingly pressing esc and accidentally quitting Claws.

If you want to scroll through the logs, while in Esc mode press the arrow keys, PgUp/PgDown, Home/End. Keep in mind that pressing any of these will disable autoscroll, so new elements from the log won't be shown unless you scroll down.

When you're typing text into the field, you can browse through the history of previous text, even in previous sessions, in a bash-like fashion.

Advanced usage

There are also more actions you can activate using ESC + key, that are generally not used on a day-to-day basis.

Letter Meaning
t Toggle timestamps before messages in console.
j Toggle auto-detection of JSON in server messages and automatic tab indentation.
h View help/welcome screen with quick commands.
R Go into replace/overtype mode (can also be done by pressing Insert a couple of times).

Configuration

Claws stores its configuration file in ~/.config/claws.json. You are welcome to hack it and change values to how you see fit. Here's a list of the values: obvious settings are ignored.

  • Timestamp: a timestamp with which all messages to the console should be prefixed. The defaults can be toggled using the t key in esc mode, although you can also use your own prefix, following Go's system of formatting dates. The default values are an empty string "" or "2006-01-02 15:04:05 ".
  • LastWebsocketURL: URL of the last websocket you connected to. Used when connecting using the c key without specifying an URL.
  • LastActions: 50 most recent messages you sent to the console, used for seeking through history using up and down.

Pipe

Piping allows you to log the messages you send and the messages you receive, or do any kind of pre-processing before they are sent or before they are shown on the console.

Pipes are specified by the Pipe configuration variable. It defaults to null - to set it, create an array containing in the first place a command and then the arguments for it. This should be a command available in your $PATH or an absolute path.

For UNIX system, this means you can do logging effectively using tee. The most basic form of logging may look like this:

"Pipe": {
	"In": ["tee", "-a", "received_messages.log"],
	"Out": ["tee", "-a", "sent_messages.log"]
}

This will append to the given log files the received and sent messages. But it doesn't have to stop there! You can really create any script that may do any pre-processing you want to the messages you receive and those you send. If you intend to write a non-trivial script, here are things that might come useful to know:

  • Any non-zero exit code will show an error on the console.
  • The program should be pretty fast to run, as the message can't be shown until the processing has finished.
  • There are some environment variables which provide information on the connection:
    • CLAWS_PIPE_TYPE: The type of pipe; either in or out.
    • CLAWS_SESSION: UNIX timestamp in microseconds of when the session was started.
    • CLAWS_CONNECTION: UNIX timestamp in microseconds of when the connection was started.
    • CLAWS_WS_URL: WebSocket URL we're connected to.

The sky is the limit here, so you can really do anything you can think of. Here are some examples (feel free to add more with a PR!):

Contributing

Claws is mostly feature-complete, though we have something that might interest you on our issue list. If, instead, you're interested in reporting a bug or asking for a new feature, you can create a new issue. There are no real contribution guidelines, but try to write some good Go code and use go fmt :).

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].