just a runnable instance of lrcd

make even prettier

+14 -5
+14 -5
main.go
··· 5 5 "github.com/rachel-mp4/lrcd" 6 6 "net/http" 7 7 "os" 8 + "time" 8 9 ) 9 10 10 11 func main() { ··· 17 18 panic(err) 18 19 } 19 20 fmt.Println("serving lrcd on localhost:8080") 20 - http.ListenAndServe(":8080", guessIfUpgradeFail(server)) 21 + now := time.Now() 22 + http.ListenAndServe(":8080", guessIfUpgradeFail(server, now)) 21 23 } 22 24 23 - func guessIfUpgradeFail(server *lrcd.Server) http.HandlerFunc { 25 + func guessIfUpgradeFail(server *lrcd.Server, now time.Time) http.HandlerFunc { 24 26 return func(w http.ResponseWriter, r *http.Request) { 25 27 if r.Header.Get("Upgrade") != "websocket" { 26 - fmt.Fprintf(w, `hi! i am an lrc server 27 - i think you should try connecting to me with an lrc client (e.g. tty!xcvr) 28 + fmt.Fprintf(w, ` 29 + ~live~~ 30 + ~relay~ 31 + ~~chat~ 32 + hi! i am an lrc server! 33 + you can look at my code at tangled.org/moth11.net/lrcd & tangled.org/lrcdaemon 34 + 35 + i think you should try connecting to me with an lrc client (e.g. tty!xcvr (@tangled.org/moth11.net/ttyxcvr)) 28 36 it'll be more fun for us both! 29 37 30 - currently connected: %d`, server.Connected()) 38 + currently connected: %d 39 + live since: %s`, server.Connected(), now.Format(time.RubyDate)) 31 40 } else { 32 41 server.WSHandler()(w, r) 33 42 }