mirror of
https://github.com/longsleep/realtimetraffic.git
synced 2024-11-16 08:48:33 +01:00
Cleanup
This commit is contained in:
parent
50380415b9
commit
adc1e2af5f
2 changed files with 0 additions and 9 deletions
|
@ -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.
|
||||
```
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue