{"action":"opened","issue":{"url":"https://api.github.com/repos/googollee/go-socket.io/issues/116","labels_url":"https://api.github.com/repos/googollee/go-socket.io/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/googollee/go-socket.io/issues/116/comments","events_url":"https://api.github.com/repos/googollee/go-socket.io/issues/116/events","html_url":"https://github.com/googollee/go-socket.io/issues/116","id":130455841,"number":116,"title":"Can't receive any events/messages","user":{"login":"chOOnz","id":12516018,"avatar_url":"https://avatars.githubusercontent.com/u/12516018?v=3","gravatar_id":"","url":"https://api.github.com/users/chOOnz","html_url":"https://github.com/chOOnz","followers_url":"https://api.github.com/users/chOOnz/followers","following_url":"https://api.github.com/users/chOOnz/following{/other_user}","gists_url":"https://api.github.com/users/chOOnz/gists{/gist_id}","starred_url":"https://api.github.com/users/chOOnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chOOnz/subscriptions","organizations_url":"https://api.github.com/users/chOOnz/orgs","repos_url":"https://api.github.com/users/chOOnz/repos","events_url":"https://api.github.com/users/chOOnz/events{/privacy}","received_events_url":"https://api.github.com/users/chOOnz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-01T19:18:31Z","updated_at":"2016-02-01T19:18:31Z","closed_at":null,"body":"I am switching from node socket.io to go socket.io and want to use my \"old\" client code to connect to the go websocket server and send a message which then will be handled by the server. Here is my code:\r\n\r\n`func main() {\r\n\tserver, err := socketio.NewServer(nil)\r\n\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\r\n\tserver.On(\"connection\", func(socket socketio.Socket) {\r\n\t\tlog.Println(\"Client connected!\")\r\n\r\n\t\tsocket.On(\"test\", func(userID string) {\r\n                        //This event is never triggered\r\n\t\t})\r\n\r\n\t\tsocket.On(\"disconnection\", func() {\r\n\t\t\tsocketList.Remove(socket)\r\n\t\t})\r\n\t})\r\n\r\n\tserver.On(\"error\", func(socket socketio.Socket, err error) {\r\n\t\tlog.Println(\"error: \", err)\r\n\t})\r\n\r\n\thttp.HandleFunc(\"/socket.io/\", func(response http.ResponseWriter, request *http.Request) {\r\n\t\tresponse.Header().Set(\"Access-Control-Allow-Credentials\", \"true\")\r\n\t\tresponse.Header().Set(\"Access-Control-Allow-Origin\", \"http://localhost:4865\")\r\n\t\tserver.ServeHTTP(response, request)\r\n\t})\r\n\r\n\tlog.Println(\"Listening on port 3000...\")\r\n\tlog.Fatal(http.ListenAndServe(\":3000\", nil))\r\n}`\r\n\r\nI need to set the access control headers in order to be able to connect to the server properly.\r\n\r\nMy JS:\r\n\r\n`socket.on('connect', function(){\r\n\tsocket.emit('test', 'some data');\r\n});`"}}