33 lines
463 B
Go
33 lines
463 B
Go
|
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)
|
||
|
}
|
||
|
|
||
|
server, err := servers.NewServer(addr)
|
||
|
if err != nil {
|
||
|
log.Fatalf("servers.New(...): %s\n", err)
|
||
|
}
|
||
|
|
||
|
log.Printf("Trying to serve at %q\n", addr)
|
||
|
server.ListenAndServe()
|
||
|
}
|