mirror of
https://github.com/cadmium-im/zirconium-go.git
synced 2024-11-23 10:52:24 +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() {
|
func main() {
|
||||||
|
internal.InitializeContext("localhost")
|
||||||
router := mux.NewRouter()
|
router := mux.NewRouter()
|
||||||
router.HandleFunc("/", func(response http.ResponseWriter, request *http.Request) {
|
router.HandleFunc("/", func(response http.ResponseWriter, request *http.Request) {
|
||||||
response.Write([]byte("Zirconium server is up and running!"))
|
response.Write([]byte("Zirconium server is up and running!"))
|
||||||
|
@ -12,7 +12,9 @@ type ConnectionHandler struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewConnectionHandler() *ConnectionHandler {
|
func NewConnectionHandler() *ConnectionHandler {
|
||||||
return &ConnectionHandler{}
|
return &ConnectionHandler{
|
||||||
|
connections: make(map[string]*OriginC2S),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ch *ConnectionHandler) HandleNewConnection(wsocket *websocket.Conn) {
|
func (ch *ConnectionHandler) HandleNewConnection(wsocket *websocket.Conn) {
|
||||||
|
Loading…
Reference in New Issue
Block a user