basic Kick support
This commit is contained in:
@@ -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
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user