mirror of
https://github.com/taigrr/log-socket
synced 2025-01-18 04:53:14 -08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
b65a10e7a8
|
@@ -7,7 +7,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func LogSocketViewHandler(w http.ResponseWriter, r *http.Request) {
|
func LogSocketViewHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
wsResource := "ws://" + r.Host + r.URL.Path
|
wsResource := r.Host + r.URL.Path
|
||||||
|
if r.TLS != nil {
|
||||||
|
wsResource = "wss://" + wsResource
|
||||||
|
} else {
|
||||||
|
wsResource = "ws://" + wsResource
|
||||||
|
}
|
||||||
wsResource = strings.TrimSuffix(wsResource, "/") + "/ws"
|
wsResource = strings.TrimSuffix(wsResource, "/") + "/ws"
|
||||||
homeTemplate.Execute(w, wsResource)
|
homeTemplate.Execute(w, wsResource)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user