0.2.10 • Published 5 years ago

streamhut v0.2.10

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

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.
  • Originally created this to quickly share data and files between devices.
  • 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.

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

Install

$ go get github.com/streamhut/streamhut/cmd/streamhut

Self-host

One-liner to self-host using Docker:

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

Getting Started

One liner to stream your terminal:

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

Example of streaming tail of file:

# terminal 1
$ cat >data.txt
# terminal 2
$ tail -F data.txt | nc streamhut.io 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 to both stdout and netcat:

$ (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))

CLI

$ streamhut --help

  Streamhut lets you stream and share your terminal.
  For more info, visit: https://github.com/streamhut/streamhut

  Usage:
    streamhut [flags]
    streamhut [command]

  Available Commands:
    help        Help about any command
    listen      Listen on a channel
    server      Start server

  Flags:
        --help   Show help

  Use "streamhut [command] --help" for more information about a command.

Usage

Run your own server:

$ streamhut server

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

Stream to your server:

$ exec > >(nc localhost 1337) 2>&1

For more options, run streamhut server --help

Listening on a channel

# terminal 1
$ streamhut listen -h localhost -p 8080 -i -c yo
# terminal 2
$ exec > >(nc localhost 1337) 2>&1;echo \#yo

For more options, run streamhut listen --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

Test

make test

Development

Start server:

make start

Run migrations:

make migrate

FAQ

  • Q: How is the stream log data stored?

    • A: Currently it's stored in a local sqlite3 database. More robust and scalable options are in the works.
  • 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) 2>&1;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

License

Released under the Apache 2.0 license.

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.0.0

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.18

5 years ago

0.0.17

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago