Modular pagination library

Lembaran provides utilities for fetching paged responses:

wsta

The WebSocket Transfer Agent

wsta is a cli tool written in rust for interfacing with WebSockets. wsta has the philosophy of being an easy tool to learn and thus gets out of your way to let you work your UNIX magic directly on the WebSocket traffic. The way wsta does this is to be as pipe-friendly as possible, letting you chain it into complex pipelines or bash scripts as you see fit, or just keep it simple and use it as is.

See the manual or type man wsta for details.

Cool things you can do

Since wsta is really pipe-friendly, you can easily work with your output in a way that suits you. If you have a websocket-service that returns JSON, you might want to have your data printed in a nice, readable format. jq is perfect for that.

Because wsta reads from stdin, it can also be used as an interactive prompt if you wish to send messages to the server interactively.

If you're debugging some nasty problem with your stream, you are probably only interested in frames related to your problem. Good news, grep is here to save the day!

Use wsta to monitor your websocket uptime. Use the --ping option to keep the connection alive, and check the exit code for issues. You can also send the last few messages with POST data for a higher quality alert.

If you need to load test your server over a WebSocket connection, it is simple to write a short bash script to do this. The following example uses a loop to continously send messages to the server and saturate the connection as much as possible. This example could also be ran in parallel as many times as required to add more saturated connections to the load test.

wsta also supports binary data using the --binary argument. When provided, all data read from stdin is assumed to be in binary format. The following simplified example records a binary stream from the microphone and sends it continously to the server, reading the response JSON as it comes in.

For more information on binary mode, see the manual and #5.

Configuration profiles

A neat feature of wsta is the ability to have several separate configuration profiles. Configuration profiles are basically presets of CLI arguments like urls and headers saved to a file for easy reuse at a later point.

If you have web services in different environments, you might for example want to have a foo-dev and foo-prod configuration file. This makes it easy to at a later date connect to foo by simply running wsta -P foo-dev,

These files could be checked into VCS and shared between colleagues.

An example of a configuration file:

See the manual for more information.

Installation

Requirements

Currently the only requirement to run wsta is rust-openssl. If you get an error about a missing ssllib.so or similar, try installing OpenSSL runtime libraries and headers. Have a look at this link for instructions on how to do so.

64-bit Linux

I've set up a download page here that you can get wsta

https://software.opensuse.org/download.html?project=home%3Aesphen&package=wsta

I'm working on getting more distributions, as well as 32-bit into the Open Build Service pipeline, which is what creates the releases on that page. For now, you need a 64-bit system to use that page. If you don't use a 64-bit system, have a look below at binaries or compiling it yourself.

Gentoo Linux

wsta can be found in the Gentoo portage tree as dev-util/wsta. In order to install it, simply run the following command.

emerge dev-util/wsta

Mac OS X

To install on Max OS X, ensure you have homebrew installed, then run the following commands. It's going to take a while, please be patient.

brew tap esphen/wsta https://github.com/esphen/wsta.git
brew install wsta

You can also find binary releases on the releases page.

Other Linux distributions

I only provide so many Linux distros on OBS, and only 64-bit versions. If your computer does not fit into the distros provided, then have a look at the download section of the most recent release, and place the attached binary into your $PATH.

https://github.com/esphen/wsta/releases

Windows

Windows binaries are compiled for each release. Ensure you have a command prompt with GNU libraries, for example the git prompt, and run the provided binary file from there.

You can find binary releases on the releases page.

Compile it yourself

DON'T PANIC. It's really easy to compile and install wsta yourself! Rust provides solid tools like cargo for automating the compilation. If you compile wsta yourself, it should run on all of rust's supported platforms.

# Install the rust language and tools
curl https://sh.rustup.rs -sSf | sh

# Install gcc and OpenSSL on your OS
dnf install -y gcc openssl-devel

# Install wsta to `$HOME/.cargo` or `$CARGO_HOME` if set.
# To change the install path, try setting --root to a directory like /usr/local
cargo install --git https://github.com/esphen/wsta.git

Development setup

Install the rust language and tools.

curl https://sh.rustup.rs -sSf | sh

Run the program

cargo run -- -vvv -I -e ws://echo.websocket.org

In order to generate the man page, groff is needed

make man

If updates to the man page are done, remember to generate the markdown manual afterwards

make wsta.md

Information - Updated May 26, 2022

Stars: 618
Forks: 22
Issues: 11

Repositories & Extras

Rust library for Self Organising Maps (SOM)

Add rusticsom as a dependency in Cargo

Rust library for Self Organising Maps (SOM)

Rust library for parsing configuration files

The 'option' can be any string with no whitespace

Rust library for parsing configuration files

Rust library for the Pimoroni Four Letter pHAT

This library aims to port ht16k33 (or rather a fork, as of right now) so credit goes to ht16k33-diet

Rust library for the Pimoroni Four Letter pHAT

Rust library for emulating 32-bit RISC-V

This library can execute instructions against any memory and register file that implements

Rust library for emulating 32-bit RISC-V

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

You can use actix-web as a backend instead of hyper

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

enabling remote control support for embedded project

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

open up an issue on this repository and let us know

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

Rust library for parsing COLLADA files

Notice: This library is built around files exported from Blender 2

Rust library for parsing COLLADA files

Rust library for low-level abstraction of MIPS32 processors

This project is licensed under the terms of the MIT license

Rust library for low-level abstraction of MIPS32 processors
Facebook Instagram Twitter GitHub Dribbble
Privacy