shelldoor/cmd/shserver/main.go

33 lines
485 B
Go
Raw Normal View History

2024-09-25 22:56:40 +03:00
package main
import (
flags "flag"
"log"
"os"
"surdeus.su/util/shelldoor/servers"
)
func main() {
var (
addr string
)
flags.StringVar(&addr, "addr", ":20000", "address to serve at")
flags.Parse()
args := flags.Args()
if len(args) > 0 {
flags.Usage()
os.Exit(1)
}
2024-09-28 19:26:08 +03:00
server, err := servers.NewServer(servers.ServerConfig{})
2024-09-25 22:56:40 +03:00
if err != nil {
log.Fatalf("servers.New(...): %s\n", err)
}
log.Printf("Trying to serve at %q\n", addr)
2024-09-28 19:26:08 +03:00
server.ListenAndServe(addr)
2024-09-25 22:56:40 +03:00
}