This commit is contained in:
Simon Eisenmann 2017-05-22 15:01:06 +02:00
parent 50380415b9
commit adc1e2af5f
2 changed files with 0 additions and 9 deletions

View file

@ -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.
```

View file

@ -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)
}
}