Skip to content
No description, website, or topics provided.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
playground
.gitignore
LICENSE
README.md
cert.go
goserve.go
ip.go
randstr.go

README.md

Share a file via TLS.

Just for fun, you can do this with ncat:

# host
$ ncat -l --send-only --ssl --ssl-cert test-cert.pem --ssl-key test-key.pem < file-to-send

# client
$ ncat --recv-only --ssl host-name > save-to-file

What it does

  • auto-generated cert (in memory)
  • serve file via https

Install

$ go get -u github.com/usrjim/goserve

Examples

-f is required:

$ goserve
Usage: goserve -f [file] [-u [uri] -p [port] -i [inet]]

IP is first network interface that is not lo0 default port is :3939 and default uri is generated random string:

$ goserve -f sample.pdf

Serving file sample at
https://192.168.1.120:3939/dzzRMXrFDA

[Press Ctrl-c to stop]

with all arguments provided:

$ goserve -f sample.pdf -p :3434 -i eth0 -u download

Serving file sample.pdf at 
https://192.168.1.120:3434/download

[Press Ctrl-c to stop]
You can’t perform that action at this time.