Initial commit: minimal relay server and CLI structure
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.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user