mirror of
https://github.com/cadmium-im/zirconium-go.git
synced 2024-12-27 11:21:51 +00:00
Add context initializing and fix error when creating connection (assigning to nil map)
This commit is contained in:
parent
a5e6fa72ff
commit
5e094d6c45
@ -17,6 +17,7 @@ var upgrader = websocket.Upgrader{
|
||||
}
|
||||
|
||||
func main() {
|
||||
internal.InitializeContext("localhost")
|
||||
router := mux.NewRouter()
|
||||
router.HandleFunc("/", func(response http.ResponseWriter, request *http.Request) {
|
||||
response.Write([]byte("Zirconium server is up and running!"))
|
||||
|
@ -12,7 +12,9 @@ type ConnectionHandler struct {
|
||||
}
|
||||
|
||||
func NewConnectionHandler() *ConnectionHandler {
|
||||
return &ConnectionHandler{}
|
||||
return &ConnectionHandler{
|
||||
connections: make(map[string]*OriginC2S),
|
||||
}
|
||||
}
|
||||
|
||||
func (ch *ConnectionHandler) HandleNewConnection(wsocket *websocket.Conn) {
|
||||
|
Loading…
Reference in New Issue
Block a user