kopia lustrzana https://github.com/cyoung/stratux
Roll back webserver, use Go as webserver.
rodzic
bcf7bbb053
commit
1308e74587
|
@ -39,7 +39,7 @@ import (
|
||||||
const (
|
const (
|
||||||
configLocation = "/etc/stratux.conf"
|
configLocation = "/etc/stratux.conf"
|
||||||
indexFilename = "/var/log/stratux/LOGINDEX"
|
indexFilename = "/var/log/stratux/LOGINDEX"
|
||||||
managementAddr = ":8080"
|
managementAddr = ":80"
|
||||||
debugLog = "/var/log/stratux.log"
|
debugLog = "/var/log/stratux.log"
|
||||||
maxDatagramSize = 8192
|
maxDatagramSize = 8192
|
||||||
maxUserMsgQueueSize = 25000 // About 10MB per port per connected client.
|
maxUserMsgQueueSize = 25000 // About 10MB per port per connected client.
|
||||||
|
|
|
@ -304,10 +304,19 @@ func setJSONHeaders(w http.ResponseWriter) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func defaultServer(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// setNoCache(w)
|
||||||
|
|
||||||
|
http.FileServer(http.Dir("/var/www")).ServeHTTP(w, r)
|
||||||
|
}
|
||||||
|
|
||||||
func managementInterface() {
|
func managementInterface() {
|
||||||
weatherUpdate = NewUIBroadcaster()
|
weatherUpdate = NewUIBroadcaster()
|
||||||
trafficUpdate = NewUIBroadcaster()
|
trafficUpdate = NewUIBroadcaster()
|
||||||
|
|
||||||
|
http.HandleFunc("/", defaultServer)
|
||||||
|
http.Handle("/logs/", http.StripPrefix("/logs/", http.FileServer(http.Dir("/var/log"))))
|
||||||
|
|
||||||
http.HandleFunc("/status",
|
http.HandleFunc("/status",
|
||||||
func(w http.ResponseWriter, req *http.Request) {
|
func(w http.ResponseWriter, req *http.Request) {
|
||||||
s := websocket.Server{
|
s := websocket.Server{
|
||||||
|
|
Ładowanie…
Reference in New Issue