nu_plugin_ws
A plugin for Nushell, a cross-platform shell and scripting language. This plugin adds support for streaming from a websocket.
Installation
Cargo
Get the latest version from crates.io with a local install:
# Downloads and installs the plugin
# Registers the plugin with Nushell
# Activates the plugin
Manual build
Manual builds can also be used:
# Clone the repository
# Enter the repo folder
# Build a release version of the plugin
# Registers the plugin with Nushell
# Activates the plugin
Usage
Basic Connection
Connect to a WebSocket and stream data:
# Connect and listen only
# With timeout
Sending Messages
Send text messages by piping string data:
# Send a text message
|
# Send JSON data
|
# Send with custom headers
|
Send binary data:
# Send binary data (hex format)
|
# Send file contents as binary
|
Advanced Usage
# Multiple custom headers
# With timeout and verbose logging
|
# Handle special characters and Unicode
|
Development
This project uses pre-commit hooks to ensure code quality. See CONTRIBUTING.md for setup instructions.
Quick setup:
# Install pre-commit
# Install the git hooks