• This repository has been archived on 19/Nov/2022
  • Stars
    star
    887
  • Rank 51,456 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Stream your terminal to web without installing anything 🌐


logo


streamhut

Stream and send data, terminal to web and vice versa.

License Build Status Go Report Card GoDoc

Synopsis

  • Stream your terminal to anyone without installing anything.
  • Path names map to channels.
  • Anyone in the same channel can view what's streamed.
  • Easily self-host your own streamhut server.

Streamhut allows you to stream (pipe) realtime data from your terminal stdout/stderr to a web xterm UI or even to another terminal. It also allow you to quickly share data and files between devices.

As long as you have netcat which comes pre-installed in most *nix systems than you can use streamhut! If you can't install netcat, you may also use the streamhut CLI client.

⚠️ Disclaimer: This software is alpha quality and not production ready. Use at your own risk!

Demo

https://streamhut.io

Demo

Getting Started (without installing anything)

One liner to stream your terminal:

$ exec &> >(nc stream.ht 1337)

The above command pipes stdout and stderr of new bash shell to streamhut.

Stream to a custom channel name:

$ exec &> >(nc stream.ht 1337);echo \#mychannel

Example of streaming tail of file:

# terminal 1
$ cat > data.txt
# terminal 2
$ tail -F data.txt | nc stream.ht 1337

Stream the current date every second:

$ while true; do date; sleep 1; done | nc stream.ht 1337

Stream output of a program (delay is required to see share url):

$ (sleep 5; htop) | nc stream.ht 1337
# waits 5 seconds, and then send contents of program.

Example of piping a program to both stdout and streamhut:

$ (echo -n; sleep 5; htop) | tee >(nc stream.ht 1337)

Don't have netcat available? Pipe to a file descriptor with an open TCP connection:

$ exec 3<>/dev/tcp/stream.ht/1337 && head -1 <&3 && exec &> >(tee >(cat >&3))

Install

$ go get github.com/streamhut/streamhut

CLI

Example of using streamhut CLI:

Stream to server

Piping commands:

$ htop | streamhut

Add delay to see share url:

$ htop | streamhut -d 5

Open url in browser:

$ htop | streamhut -o

Stream to different server:

$ htop | streamhut -h example.com -p 1337

Stream to custom channel:

$ htop | streamhut -c mychannel

For more options, run streamhut --help

Run your own server:

$ streamhut server

Starting server...
HTTP/WebSocket port: 8080
TCP port: 1337

Run server with SSL/TLS:

$ mkcert localhost

$ sudo streamhut server --tls --tls-cert=localhost.pem --tls-key=localhost-key.pem -p 443

For more options, run streamhut server --help

Connecting to a channel

# terminal 1
$ streamhut connect -c mychannel

For more options, run streamhut connect --help

Docker

You can run streamhut as a Docker container:

$ docker pull streamhut/streamhut
$ docker run -e PORT=8080 -e TCP_PORT=1337 -p 8080:8080 -p 1337:1337 --restart unless-stopped streamhut/streamhut:latest

Self-host (docker one-liner)

One-liner to self-host using Docker:

docker run -p 8080:8080 -p 1337:1337 streamhut/streamhut

Test

make test

Development

Start server:

make start

Run migrations:

make migrate

Web App

The web app source code is found on https://github.com/streamhut/web.

FAQ

  • Q: How is the stream log data stored?

    • A: Currently it's stored in a local sqlite3 database. You can disable storage with the --no-storage flag, e.g. streamhut server --no-storage.
  • Q: What happened to the streamhut NPM module?

  • Q: Can the same channel be used more than once?

    • A: Yes! send #{channel} (ie #mychannel) as the first stream text to use that channel.

      Example:

      exec &> >(nc stream.ht 1337);echo \#mychannel
  • Q: What's the difference between stream.ht and streamhut.io?

    • A: The domain stream.ht is an alias for streamhut.io, meaning you can type stream.ht as the domain for convenience. Other aliases are streamhut.net and streamhut.org.
  • Q: What is the difference between exec > >(nc stream.ht 1337) 2>&1 and exec &> >(nc stream.ht 1337)

    • A: They are the same in that they both stream stdout and stderr to the server.

License

Released under the Apache 2.0 license.

Β© Miguel Mota

More Repositories

1

golang-for-nodejs-developers

Examples of Golang compared to Node.js for learning πŸ€“
Go
4,577
star
2

ethereum-development-with-go-book

πŸ“– A little guide book on Ethereum Development with Go (golang)
Go
1,724
star
3

ethereum-input-data-decoder

Ethereum smart contract transaction input data decoder
JavaScript
571
star
4

awesome-amazon-alexa

πŸ—£Curated list of awesome resources for the Amazon Alexa platform.
560
star
5

go-ethereum-hdwallet

Ethereum HD Wallet derivations in Go (golang)
Go
412
star
6

solidity-idiosyncrasies

Solidity gotchas, pitfalls, limitations, and idiosyncrasies.
Solidity
347
star
7

bash-streams-handbook

πŸ’» Learn Bash streams, pipelines and redirection, from beginner to advanced.
238
star
8

spectrogram

Audio spectrogram in canvas.
JavaScript
187
star
9

Navigator.sendBeacon

Polyfill for Navigator.sendBeacon()
JavaScript
160
star
10

alexa-voice-service.js

Library for interacting with Alexa Voice Service (AVS) in the browser.
JavaScript
130
star
11

merkletreejs-solidity

Construct merkle trees with MerkleTree.js and verify merkle proofs in Solidity.
JavaScript
126
star
12

solidity-create2-example

Example of how to use the CREATE2 opcode released in the Constantinople update for Ethereum
JavaScript
119
star
13

sobel

Sobel Filter algorithm in JavaScript.
JavaScript
96
star
14

pixelate

Pixelate an image with canvas.
JavaScript
94
star
15

merkletreejs-nft-whitelist

Solidity NFT whitelist contract example using MerkleTree.js for constructing merkle root and merkle proofs.
JavaScript
74
star
16

awesome-token-curated-registries

Curated list of awesome Token Curated Registry (TCR) resources.
69
star
17

is-valid-domain

Validate domain name in JavaScript
JavaScript
68
star
18

solidity-audit-checklist

A checklist of things to look for when auditing Solidity smart contracts.
64
star
19

go-solidity-sha3

Generate Solidity SHA3 (Keccak256) hashes in Go (golang)
Go
61
star
20

go-web3-examples

Example of how to use "Web3" in golang.
Go
61
star
21

keccak256

A wrapper for the keccak library to compute 256 bit keccak hash in JavaScript.
JavaScript
60
star
22

cryptocharts

Cryptocurrency stats and charts displayed in your terminal.
Go
56
star
23

ethereum-hdwallet

CLI and Node.js library for Ethereum HD Wallet derivations from mnemonic
JavaScript
53
star
24

merkletreejs-multiproof-solidity

Verifying merkle multiproofs in solidity example (unaudited)
JavaScript
44
star
25

is-class

Check if function is an ES6 class.
JavaScript
43
star
26

go-coinmarketcap

The unofficial CoinMarketCap API client for Go.
Go
42
star
27

zksnarks-example

An example of how generate zero-knowledge proofs and verify using an Ethereum smart contract.
36
star
28

miguelmota.github.io

My Hugo powered blog
HTML
35
star
29

inview

Detect when element scrolled to view
JavaScript
34
star
30

intent-utterance-expander

Expand custom utterance slots of phrases, to use with Alexa Skills Kit Sample Utterances.
JavaScript
30
star
31

audio-oscilloscope

Audio oscilloscope in canvas.
JavaScript
30
star
32

is-base64

Predicate that returns true if base64 string.
JavaScript
29
star
33

eth-send

Simple way to send ether.
JavaScript
27
star
34

threejs-earth

Rotating planet Earth
JavaScript
27
star
35

global-keypress

Global key press event emitter.
C
26
star
36

sass-cheatsheet

Cheatsheet guide for Sass
25
star
37

ethereum-unit-converter

Ethereum unit converter in JavaScript
JavaScript
24
star
38

ethereum-private-key-to-address

Convert an Ethereum private key to a public address
JavaScript
24
star
39

ethereum-abi-caller

ABI method caller tool
TypeScript
23
star
40

audiobuffer-slice

Slice out a portion of an AudioBuffer.
JavaScript
23
star
41

ethereum-devtools

πŸ› οΈ A simple GUI of Ethereum tools and utilities for debugging
TypeScript
23
star
42

bitcoin-development-with-go

[Work in Progress] A little book on Bitcoin Development with Go (golang)
Go
22
star
43

go-ethutil

Ethereum utility functions for Go.
Go
21
star
44

merkletree-viz

Merke tree visualization library for browser, works with merkletreejs
JavaScript
21
star
45

ethereum-checksum-address

Convert Ethereum address to a checksummed address
JavaScript
21
star
46

ethereum-private-key-to-public-key

Convert an Ethereum private key to a public key
JavaScript
20
star
47

C4.5

C4.5 decision tree generation algorithm in JavaScript.
JavaScript
20
star
48

AVS-server

[DEPRECATED] Node.js web server for interacting with the Alexa Voice Service.
JavaScript
19
star
49

vwap

Calculate the Volume-Weighted Average Price (VWAP)
JavaScript
19
star
50

dotfiles

My dotfiles
Emacs Lisp
18
star
51

ethereum-public-key-to-address

Convert an Ethereum public key to an address
JavaScript
18
star
52

gundb-port-go

GunDB port examples in Go (golang)
Go
18
star
53

eos-merkle-proof

EOS smart contract to verify merkle proofs
C++
15
star
54

ethnotary

Document notarization on the Ethereum blockchain.
JavaScript
14
star
55

wos

Monitor traffic for unencrypted data and display a dashboard.
JavaScript
14
star
56

x86-assembly-examples

x86 Assembly language exercises I did while in school.
Assembly
14
star
57

lunch-wheel

A lunch wheel for when you can't decide.
JavaScript
13
star
58

AVS-client

DEPRECATED. Front-end application for interacting with Alexa Voice Service.
JavaScript
13
star
59

web-accessibility

Resources for developing with web accessibility in mind.
13
star
60

ASK-HackerNews

Alexa Skills Kit Hacker News app.
JavaScript
13
star
61

ethereum-checkpoint-git-commit

Checkpoint git commits to an Ethereum smart contract and verify commits as Merkle tree
JavaScript
13
star
62

http-message-parser

HTTP message parser in JavaScript.
JavaScript
13
star
63

loopback-file-upload-example

Example of using file system storage or AWS S3 for file uploads in Loopback
JavaScript
12
star
64

k-means

K-Means clustering in JavaScript.
JavaScript
12
star
65

intent-utterance-generator

Alexa Skills Kit Sample Utterances generator.
JavaScript
12
star
66

trollbox

Instant trollbox using Firebase.
JavaScript
12
star
67

mootron

A Tron like terminal theme
Vim Script
12
star
68

hidden-markov-model

Hidden Markov Models in JavaScript.
JavaScript
12
star
69

cairo-learning

Cairo lang learning notes
Makefile
11
star
70

twitter-purge

Unfollow inactive twitter accounts.
Ruby
11
star
71

metamask-vault-decrypter

CLI to decrypt MetaMask encrypted vault with password
JavaScript
11
star
72

arraybuffer-to-audiobuffer

Convert ArrayBuffer to AudioBuffer
JavaScript
11
star
73

geth-docker

Run a geth node that syncs up with rinkeby testnet in a Docker container.
Dockerfile
10
star
74

big-red-button

A node-hid based driver to read actions from the Dream Cheeky Big Red Button
JavaScript
10
star
75

is-valid-email

Validate email address
JavaScript
10
star
76

solidity-mt-vs-mmr

Solidity example comparing Merkle Tree vs Merkle Mountain Range tree gas usage.
Solidity
10
star
77

buffer-to-arraybuffer

Convert Buffer to ArrayBuffer
JavaScript
10
star
78

arraybuffer-to-buffer

Convert ArrayBuffer to Buffer
JavaScript
10
star
79

fkill

Simple bash script to kill process by name or port
Shell
10
star
80

rust-wasm-example

Example on compiling a Rust library into WebAssembly
JavaScript
10
star
81

zksync-messenger-l1-to-l2-example

Send a message from L1 Goerli to L2 zkSync testnet.
JavaScript
10
star
82

cairo.vim

Cairo lang plugin for Vim
Vim Script
10
star
83

s3scanner

Scan for open public S3 buckets
JavaScript
10
star
84

py-etherdelta

Python client for interacting with the EtherDelta API and Smart Contracts.
Python
10
star
85

terminal-tab

Open a terminal tab programatically
JavaScript
10
star
86

eth-balance

Simple way to check ether balance of an account address.
JavaScript
10
star
87

jsdoc-oblivion

A gray and blue theme for JSDoc.
JavaScript
10
star
88

vscode-ethereum-private-key-to-address

A simple VSCode extension that displays the public address of an Ethereum private key on hover.
TypeScript
10
star
89

etherdelta-gdax-theme-extension

EtherDelta GDAX-like Theme Chrome Extension
CSS
10
star
90

scroll-messenger-l2-to-l1-example

Send a message from L2 Scroll zkEVM testnet to L1 Goerli.
JavaScript
10
star
91

is-valid-hostname

Validate hostname in JavaScript based on RFC-1123
JavaScript
9
star
92

ethereum-keystore

Ethereum keystore generator and reader
JavaScript
9
star
93

tla-learning

Some examples and notes while learning TLA+ modeling language.
9
star
94

to-hex

Convert values to hex string
JavaScript
9
star
95

eos-ecverify

EOS smart contract that does ECDSA verification (ecrecover/ecverify)
C++
9
star
96

interpolate-rgb

Interpolate RGB colors in JavaScript.
JavaScript
8
star
97

mov2gif

A bash script to convert QuickTime movie (.mov) to animated gif (.gif)
Shell
8
star
98

sieve-of-eratosthenes

Sieve of Eratosthenes JavaScript implementation
JavaScript
8
star
99

stableswap-curve-example

JavaScript
8
star
100

go-webhook-server

A simple server to receive webhooks and execute commands
Go
8
star