Relay pairs connections by room name and pipes bytes between them, with no password/PAKE handshake at the relay layer — codephrase-based encryption is left to the client side of the transfer.
30 lines
419 B
Go
30 lines
419 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
"github.com/tzgyn/share/src/cli"
|
|
"github.com/tzgyn/share/src/utils"
|
|
)
|
|
|
|
func main() {
|
|
sigs := make(chan os.Signal, 1)
|
|
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
|
|
|
|
go func() {
|
|
if err := cli.Run(); err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
utils.RemoveMarkedFiles()
|
|
os.Exit(0)
|
|
}()
|
|
|
|
<-sigs
|
|
utils.RemoveMarkedFiles()
|
|
os.Exit(0)
|
|
}
|