GitHub - pvarentsov/iola: 🔄 iola: Socket client with REST API

github.com
4 min read
fairly easy
🔄 iola: Socket client with REST API. Contribute to pvarentsov/iola development by creating an account on GitHub.
🔄 iola

Description

iola - a socket client with REST API. It helps to work with socket servers using your favorite REST client.

iola tries to simplify socket server testing and support the most popular socket clients. The main way to interact with the tool is the REST API. This approach allows you to use the rich functionality of modern REST clients to work with sockets.

The potential of the tool is revealed when using API clients such as Postman, Insomnia, etc. You can manage collections of requests for projects that have socket-based API, use dynamic variables in requests and many other features supported by these clients.

Features:

Allows reading and sending messages via REST API Logs all socket events in the console Has Swagger UI for REST API Works on Linux, MacOS and Windows

Supported clients:

WebSocket Socket.IO TCP Unix socket

Installation

Via npm (for all platforms where Node.js is installed).

$ npm install -g iola

Via homebrew (Linux, MacOS).

$ brew tap pvarentsov/iola $ brew install iola

Or download standalone binary from releases (Linux, MacOS, Windows).

Usage

CLI

$ iola --help iola - a socket client with REST API Usage: iola [options] [command] Options: --version Display version --help Display help Commands: websocket|ws [options] Run websocket client socketio|io [options] Run socket.io client tcp [options] Run tcp client unix [options] Run unix client help [command] Display help for command API: GET /messages Get message list GET /messages/{id} Get message by id POST /messages Send message GET /swagger Get swagger

REST API

Swagger UI:

Get message:

Get message list:

Send any data:

Send binary data (uint8 array):

Clients

Common

All socket clients have the next options:

--api-port Set API port (default: "3000"). --api-host Set API host (default: "127.0.0.1"). --binary-encoding Encode sent / received binary messages for more readability. Supported encodings: ascii , utf8 , base64 , hex .

--no-emoji Disable emoji in the…
Read full article