24 lines
526 B
Go
24 lines
526 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
|
|
"github.com/prologic/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")
|
|
uri = flag.String("uri", "floodgap.com", "<host>:[port] to proxy to")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
// Use a config struct
|
|
log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *uri))
|
|
}
|