1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package main
import (
"flag"
"log"
"git.feuerfuchs.dev/Feuerfuchs/gopherproxy"
)
var (
// TODO: Allow config file and environment vars
// (opt -> env -> config -> default)
bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to")
robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file")
robotsdebug = flag.Bool("robots-debug", false, "print output about ignored robots.txt")
uri = flag.String("uri", "floodgap.com", "<host>:[port] to proxy to")
vipsconcurrency = flag.Int("vips-concurrency", 1, "Concurrency level of libvips")
)
func main() {
flag.Parse()
// Use a config struct
log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *robotsdebug, *vipsconcurrency, *uri))
}
|