soju/cmd/jounce/main.go

34 lines
573 B
Go
Raw Normal View History

2020-02-04 09:46:22 +00:00
package main
import (
"log"
"net"
"git.sr.ht/~emersion/jounce"
)
func main() {
addr := ":6667"
ln, err := net.Listen("tcp", addr)
if err != nil {
log.Fatalf("failed to start listener: %v", err)
}
2020-02-06 15:03:07 +00:00
// TODO: load from config/DB
2020-02-06 14:50:46 +00:00
s := jounce.Server{
Hostname: "localhost",
2020-02-06 15:03:07 +00:00
Logger: log.New(log.Writer(), "", log.LstdFlags),
Upstreams: []jounce.Upstream{{
Addr: "chat.freenode.net:6697",
Nick: "jounce",
Username: "jounce",
Realname: "jounce",
}},
2020-02-06 14:50:46 +00:00
}
2020-02-04 10:25:53 +00:00
2020-02-04 09:46:22 +00:00
log.Printf("Server listening on %v", addr)
2020-02-06 15:03:07 +00:00
go s.Run()
2020-02-04 10:25:53 +00:00
log.Fatal(s.Serve(ln))
2020-02-04 09:46:22 +00:00
}