diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gopherproxy/main.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/gopherproxy/main.go b/cmd/gopherproxy/main.go index 9a7d1f9..84bde30 100644 --- a/cmd/gopherproxy/main.go +++ b/cmd/gopherproxy/main.go | |||
@@ -8,12 +8,16 @@ import ( | |||
8 | ) | 8 | ) |
9 | 9 | ||
10 | var ( | 10 | var ( |
11 | bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to") | 11 | // TODO: Allow config file and environment vars |
12 | uri = flag.String("uri", "floodgap.com", "<host>:[port] to proxy to") | 12 | // (opt -> env -> config -> default) |
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") | ||
15 | uri = flag.String("uri", "floodgap.com", "<host>:[port] to proxy to") | ||
13 | ) | 16 | ) |
14 | 17 | ||
15 | func main() { | 18 | func main() { |
16 | flag.Parse() | 19 | flag.Parse() |
17 | 20 | ||
18 | log.Fatal(gopherproxy.ListenAndServe(*bind, *uri)) | 21 | // Use a config struct |
22 | log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *uri)) | ||
19 | } | 23 | } |