make weave status show whether encryption is on/off

Closes #323.
This commit is contained in:
Matthias Radestock committed 2015-01-09 12:56:26 +00:00
1 parent f70dfe9de8
commit 11b87f879a
2 files changed
+6

No files matched your search

+1
View File
@@ -57,6 +57,7 @@ This produces output like:
````
weave router 0.7.0
Encryption off
Our name is 7a:f4:56:87:76:3b
Sniffing traffic on &{39 65535 ethwe ae:e3:07:9c:8c:d4 up|broadcast|multicast}
MACs:
+5
View File
@@ -135,8 +135,13 @@ func main() {
}
func handleHttp(router *weave.Router) {
encryption := "off"
if router.Password != nil && len(*router.Password) > 0 {
encryption = "on"
}
http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, fmt.Sprintln("weave router", version))
io.WriteString(w, fmt.Sprintln("Encryption", encryption))
io.WriteString(w, router.Status())
})
http.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) {