Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

Commit

Permalink
Fix listen channel config
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Jul 4, 2020
1 parent 378aa9a commit 3c2e7c8
Show file tree
Hide file tree
Showing 13 changed files with 285 additions and 14 deletions.
15 changes: 8 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ builds:
- CGO_ENABLED=0
main: ./cmd/streamhut/main.go
binary: streamhut
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
archives:
-
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
## 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.
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`](https://en.wikipedia.org/wiki/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.

Expand Down
2 changes: 1 addition & 1 deletion cmd/streamhut/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ For more info, visit: https://github.com/streamhut/streamhut`,
})

return sclient.Listen(&client.ListenConfig{
Channel: channel,
Channel: listenChannel,
})
},
}
Expand Down
145 changes: 145 additions & 0 deletions dist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@


## Changelog

61f3724 0.2.5
bb671e6 Add Dockerfile
4489e8d Add README badges
a08be96 Add open in browser flag
b248243 Add optional bandwidth quota limit
c4c99da Apache 2.0 License
c11200c CLI options, go mod vendor
3bf6842 Clear gitignore cache
4b80501 Client pipe
b50ebc1 Copy migrations, Client shell listen
5181dd6 Download web build on start
b7631df Execute schema on start
9f900f7 Fix listen channel config
c71ba66 Golang rewrite
61d3154 Home page and examples
7f15605 Merge branch 'golang_rewrite'
ed01792 Share base url default to host url env var
f3033b0 Standardize port options
378aa9a TLS support for server
b1e5773 Update .gitignore
db9a9b2 Update FAQ
da6c123 Update README
b057d16 Update README
703147a Update README
008a5e7 Update README
955a6d9 Web app tarball path latest
bd1e270 Websocket stream history
7830310 [db] init gundb
dadb553 [server] sqlite3 storage
0ce3a72 [web] lerna npm packages
35a476c [web] styled components
72c25d6 [web] terminal fixes and blur for scrolling
df28af7 [web] terminal resizer
ebebaa2 add .travis.yml
0f60f0f add Dockerfile
b12e6da add badges
c415af2 add examples
fe1ef29 add express
6c4734c add input type text
961612e add logo
7b00198 add missing dep
96a080f add nc example
fe4a252 add players + responsive
3a81e17 add screenshot
2edc302 alias
5d11402 arraybuffer with mime type
0ca9386 bold
b507c6a buidl
8ad66a8 build bundle
fa2123a bump
94c8ab2 bump
f3ffb1e check if base64
825344f clean up
8c4d1a1 clean up
a96fa5a cli
56d1fa9 cli init
0dc2a55 cli server
b7b4459 client: stream to local server if available by default
28e65f2 don't show base64 string for zip
14df9c1 echo pipe for shells
3da89b0 file post
2545e3f fix base64 check
9241a97 fix cli bin
81d9eb8 fixes
1c866ab fullscreen option
345d519 ga
a24cd79 go mod
78b537f go mod vendor
f43111c home page demo
54b281d host url
6556f33 http proto
1331453 hyperlinkify text
fecce56 import schema on load if not exists
dad2b6d initial
ee88c7f keywords
96bbf3a lerna dep
0c4654b lerna packages
8bfa7db logo
16ad3f3 mono repo
ff98802 multiple file uploads
5da053f new images
46c17dd no idea what's in this commit
91025df npm postinstall lerna
e86f66d path fix
92fcca1 postinstall sub packages
28e3252 redirect channel without prefix
fefaf88 remove shoe, use ws
44d5c29 rename
42b6793 rm file
8915301 show live connections + copy to clipboard
73d8693 static logo
37d5924 stdin example
a014702 stdout stream + xterm
6256331 strict mode
77b58c7 style
3c29e0a synopsis
5b28af1 tcp read channel. mobile fixes
febb2ac text
63e630f typo
63f3209 typo
deeb603 typo fix
4edef8b update Dockerfile
d54b150 update client
0cbf9c1 update client
d5e7d41 update client version
172ec6e update dep
597df63 update dep
cec08de update package.json
4b6ed51 update package.json
3e34cf6 update port
46593e2 update readme
dde1c7f update readme
ecd0e07 update readme
28320dc update readme
a901561 update readme
cf25daf update readme
f1643af update readme
0386bd1 update readme
57a9667 update readme
26ff7a0 update readme
d07b69d update readme
a4a03b4 update readme
d5d30b6 update server
051318f update server
b66cbef update server
2174755 update server version
a888b3a update version
3bc0db0 update window title + favicon on new message unfocused
346b1fb updates
5dfa145 updates
d773cbe use clipboardjs
2945420 use different server for websockets
a65ad50 use keeccakjs
86fd0ac use one websocket server
ef2cee9 use page scheme
66e39a7 use pre el
cdf053d use uuid instead
584d289 vump
d65cc71 xterm fit + convert eol + text decoder
74b6b5a xterm font

4 changes: 4 additions & 0 deletions dist/checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
c689726f3b7a2efeb3258d11f1dc86efadc6fac4e658de0282a6e99fbf785df7 streamhut_0.0.3_Darwin_x86_64.tar.gz
24e0748e862e878b16767a193e496a155aef04de8be70fdedd0479536757024f streamhut_0.0.3_Linux_i386.tar.gz
277feb218489e2182783e5083d687cc18e96a4b3b4652b76fd55147b45eba359 streamhut_0.0.3_Linux_x86_64.tar.gz
8695bb9807de954163b2cfb33e00ec166be556b5bd0d65137aac0b6c293cbbc4 streamhut_0.0.3_Darwin_i386.tar.gz
79 changes: 79 additions & 0 deletions dist/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
project_name: streamhut
release:
github:
owner: streamhut
name: streamhut
name_template: '{{.Tag}}'
scoop:
name: streamhut
commit_author:
name: goreleaserbot
email: [email protected]
commit_msg_template: Scoop update for {{ .ProjectName }} version {{ .Tag }}
builds:
- id: streamhut
goos:
- linux
- darwin
goarch:
- amd64
- "386"
goarm:
- "6"
targets:
- linux_amd64
- linux_386
- darwin_amd64
- darwin_386
dir: .
main: ./cmd/streamhut/main.go
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser
binary: streamhut
env:
- CGO_ENABLED=0
lang: go
archives:
- id: default
builds:
- streamhut
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
replacements:
"386": i386
amd64: x86_64
darwin: Darwin
linux: Linux
windows: Windows
format: tar.gz
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
snapshot:
name_template: '{{ .Tag }}-next'
checksum:
name_template: checksums.txt
algorithm: sha256
changelog:
filters:
exclude:
- '^docs:'
- '^test:'
sort: asc
dist: dist
env_files:
github_token: ~/.config/goreleaser/github_token
gitlab_token: ~/.config/goreleaser/gitlab_token
gitea_token: ~/.config/goreleaser/gitea_token
source:
name_template: '{{ .ProjectName }}-{{ .Version }}'
format: tar.gz
github_urls:
download: https://github.com
gitlab_urls:
download: https://gitlab.com
Binary file added dist/streamhut_darwin_386/streamhut
Binary file not shown.
Binary file added dist/streamhut_darwin_amd64/streamhut
Binary file not shown.
Binary file added dist/streamhut_linux_386/streamhut
Binary file not shown.
Binary file added dist/streamhut_linux_amd64/streamhut
Binary file not shown.
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ require (
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.3.0 // indirect
golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 // indirect
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20200702044944-0cc1aa72b347 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
38 changes: 38 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,52 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.27 h1:nqDD4MMMQA0lmWq03Z2/myGPYLQoXtmi0rGVs95ntbo=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e h1:TsjK5I7fXk8f2FQrgu6NS7i5Qih3knl2FL1htyguLRE=
golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200702044944-0cc1aa72b347 h1:/e4fNMHdLn7SQSxTrRZTma2xjQW6ELdxcnpqMhpo9X4=
golang.org/x/tools v0.0.0-20200702044944-0cc1aa72b347/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
6 changes: 3 additions & 3 deletions pkg/wsserver/wsserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ func (w *WS) Handler(wr http.ResponseWriter, r *http.Request) {
}

fmt.Println("received data")
//console.log('received: %s', data)
//console.log(`\n${pathname}\n---${data}---`)

buffer, mime := byteutil.DecoupleBufferWithMime(msg)
go w.db.InsertStreamMessage(&types.StreamMessage{
Expand All @@ -97,9 +95,11 @@ func (w *WS) Handler(wr http.ResponseWriter, r *http.Request) {
Mime: mime,
})

//fmt.Printf("%s\n---%s---\n", pathname, string(buffer))

for _, client := range w.Socks[pathname] {
fmt.Printf("Streaming to %s %s\n", client.ID, pathname)
if err = conn.WriteMessage(websocket.BinaryMessage, msg); err != nil {
if err = client.Write(msg); err != nil {
fmt.Println(err)
return
}
Expand Down

0 comments on commit 3c2e7c8

Please sign in to comment.