mirror of
https://github.com/go-i2p/newsgo.git
synced 2025-07-17 13:54:39 -04:00
enable listenin by default
This commit is contained in:
15
main.go
15
main.go
@ -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 {
|
||||
|
@ -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",
|
||||
|
Reference in New Issue
Block a user