diff --git a/README.md b/README.md index 01b5cc6..a52fafe 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ The trafficserver is basically a Websocket server pushing traffic data to any co ``` Usage of ./bin/realtimetraffic: - -client="./client": Path to client directory. -listen="127.0.0.1:8088": Listen address. ``` diff --git a/realtimetrafficd/main.go b/realtimetrafficd/main.go index c60a29b..b244a04 100644 --- a/realtimetrafficd/main.go +++ b/realtimetrafficd/main.go @@ -27,7 +27,6 @@ import ( "github.com/gorilla/websocket" ) -var staticPath *string var listenAddr *string func serveClient(w http.ResponseWriter, r *http.Request) { @@ -69,22 +68,15 @@ func serveWs(w http.ResponseWriter, r *http.Request) { func main() { var err error - staticPath = flag.String("client", "", "Full path to client directory.") listenAddr = flag.String("listen", "127.0.0.1:8088", "Listen address.") flag.Parse() go h.run() http.HandleFunc("/", serveClient) http.HandleFunc("/realtimetraffic", serveWs) - /*http.Handle("/css/", http.FileServer(http.Dir(*client))) - http.Handle("/scripts/", http.FileServer(http.Dir(*client))) - http.Handle("/img/", http.FileServer(http.Dir(*client))) - http.Handle("/favicon.ico", http.FileServer(http.Dir(*client))) - */ err = http.ListenAndServe(*listenAddr, nil) if err != nil { log.Fatal("ListenAndServe: ", err) } - }