basic Kick support

This commit is contained in:
Luxferre
2024-09-15 14:58:30 +03:00
parent 430d67913b
commit 030dfdb956
4 changed files with 7 additions and 4 deletions
+3
View File
@@ -10,6 +10,7 @@ import (
"fmt"
"log"
"strings"
"slices"
"encoding/json"
"net/http"
"io/ioutil"
@@ -98,6 +99,8 @@ func sseHandler(w http.ResponseWriter, r *http.Request) {
/* close the channel after exiting the function */
defer func() {
close(transport)
idx := slices.IndexFunc(sse_transports, func(c chan string) bool { return c == transport })
sse_transports[idx] = nil
transport = nil
}()