We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b37c90d commit e48bc7bCopy full SHA for e48bc7b
close.go
@@ -27,8 +27,12 @@ func turnOffMonitor() {
27
28
func handler(w http.ResponseWriter, r *http.Request) {
29
if r.URL.Path == "/" {
30
- turnOffMonitor()
+ // 获取客户端的 IP 地址
31
+ clientIP := r.RemoteAddr
32
+ // 打印请求关闭的 IP 地址
33
+ fmt.Printf("Received request to turn off the screen from IP: %s\n", clientIP)
34
fmt.Fprintln(w, "Screen will be turned off")
35
+ go turnOffMonitor()
36
} else {
37
http.NotFound(w, r)
38
}
0 commit comments