aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2019-06-20 15:47:04 +0200
committerFeuerfuchs <git@feuerfuchs.dev>2019-06-20 15:47:04 +0200
commitde13213492ce02464c5ecd8544ea5ae6b33fa712 (patch)
treeb227baa4ce533336fe1c8f1dbd58709d1c542714 /cmd
parentFix for unescaped HTML (diff)
downloadgopherproxy-de13213492ce02464c5ecd8544ea5ae6b33fa712.tar.gz
gopherproxy-de13213492ce02464c5ecd8544ea5ae6b33fa712.tar.bz2
gopherproxy-de13213492ce02464c5ecd8544ea5ae6b33fa712.zip
Make output about ignored robots.txt optional
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gopherproxy/main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/gopherproxy/main.go b/cmd/gopherproxy/main.go
index aced41b..e9dea18 100644
--- a/cmd/gopherproxy/main.go
+++ b/cmd/gopherproxy/main.go
@@ -10,14 +10,15 @@ import (
10var ( 10var (
11 // TODO: Allow config file and environment vars 11 // TODO: Allow config file and environment vars
12 // (opt -> env -> config -> default) 12 // (opt -> env -> config -> default)
13 bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to") 13 bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to")
14 robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file") 14 robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file")
15 uri = flag.String("uri", "floodgap.com", "<host>:[port] to proxy to") 15 robotsdebug = flag.Bool("robots-debug", false, "print output about ignored robots.txt")
16 uri = flag.String("uri", "floodgap.com", "<host>:[port] to proxy to")
16) 17)
17 18
18func main() { 19func main() {
19 flag.Parse() 20 flag.Parse()
20 21
21 // Use a config struct 22 // Use a config struct
22 log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *uri)) 23 log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *robotsdebug, *uri))
23} 24}