···1+just a simple implementation of lrcd!
2+3+lrc.example.com.conf is an example nginx config file, probably if you wanna
4+self-host this you know what you're doing better than me, but for me, i wanted
5+to serve lrcdaemon with nginx, so my setup was just to copy the config file
6+into conf.d, rename the server_name directive to be correct for my base
7+domain, and then run `sudo certbot --nginx`
8+9+then you'd connect to the server through e.g. tty!xcvr by doing `:dial
10+lrc.example.com`
11+12+it should be running right now at `lrc.moth11.net`, check it out with your
13+lrc client!
14+15+of course to run the server, `go run .`
···17 panic(err)
18 }
19 fmt.Println("serving lrcd on localhost:8080")
20+ http.ListenAndServe(":8080", guessIfUpgradeFail(server))
21+}
22+23+func guessIfUpgradeFail(server *lrcd.Server) http.HandlerFunc {
24+ return func(w http.ResponseWriter, r *http.Request) {
25+ if r.Header.Get("Connection") != "upgrade" {
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+ it'll be more fun for us both.
29+ currently connected: %d`, server.Connected())
30+ } else {
31+ server.WSHandler()(w, r)
32+ }
33+ }
34}