enable listenin by default

This commit is contained in:
idk
2022-12-06 23:23:18 +00:00
parent f60278a4bd
commit 23760d282c
2 changed files with 10 additions and 7 deletions

15
main.go
View File

@ -21,7 +21,8 @@ var (
statsfile = flag.String("statsfile", "build/stats.json", "file to store stats in")
host = flag.String("host", "127.0.0.1", "host to serve on")
port = flag.String("port", "9696", "port to serve on")
i2p = flag.Bool("i2p", false, "automatically co-host on an I2P service using SAMv3")
i2p = flag.Bool("i2p", true, "automatically co-host on an I2P service using SAMv3")
tcp = flag.Bool("http", true, "host on an HTTP service at host:port")
)
func validatePort(s *string) {
@ -109,11 +110,13 @@ func main() {
switch command {
case "serve":
s := server.Serve(*dir, *statsfile)
go func() {
if err := Serve(*host, *port, s); err != nil {
panic(err)
}
}()
if *tcp {
go func() {
if err := Serve(*host, *port, s); err != nil {
panic(err)
}
}()
}
if *i2p {
go func() {
if err := ServeI2P(s); err != nil {

View File

@ -25,7 +25,7 @@ func (n *NewsStats) Graph(rw http.ResponseWriter) {
total += v
bars = append(bars, chart.Value{Value: float64(v), Label: k})
}
bars = append(bars, chart.Value{Value: float64(total), Label: "Total Requests"})
bars = append(bars, chart.Value{Value: float64(total), Label: "Total Requests / Approx. Updates Handled"})
graph := chart.BarChart{
Title: "Downloads by language",