{"action":"created","issue":{"url":"https://api.github.com/repos/labstack/echo/issues/457","repository_url":"https://api.github.com/repos/labstack/echo","labels_url":"https://api.github.com/repos/labstack/echo/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/labstack/echo/issues/457/comments","events_url":"https://api.github.com/repos/labstack/echo/issues/457/events","html_url":"https://github.com/labstack/echo/issues/457","id":146753166,"number":457,"title":"Can't use Websockets and HTTP in the same Echo App","user":{"login":"bmhatfield","id":1119967,"avatar_url":"https://avatars.githubusercontent.com/u/1119967?v=3","gravatar_id":"","url":"https://api.github.com/users/bmhatfield","html_url":"https://github.com/bmhatfield","followers_url":"https://api.github.com/users/bmhatfield/followers","following_url":"https://api.github.com/users/bmhatfield/following{/other_user}","gists_url":"https://api.github.com/users/bmhatfield/gists{/gist_id}","starred_url":"https://api.github.com/users/bmhatfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmhatfield/subscriptions","organizations_url":"https://api.github.com/users/bmhatfield/orgs","repos_url":"https://api.github.com/users/bmhatfield/repos","events_url":"https://api.github.com/users/bmhatfield/events{/privacy}","received_events_url":"https://api.github.com/users/bmhatfield/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/labstack/echo/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/labstack/echo/labels/v2","name":"v2","color":"207de5"}],"state":"closed","locked":false,"assignee":{"login":"vishr","id":314036,"avatar_url":"https://avatars.githubusercontent.com/u/314036?v=3","gravatar_id":"","url":"https://api.github.com/users/vishr","html_url":"https://github.com/vishr","followers_url":"https://api.github.com/users/vishr/followers","following_url":"https://api.github.com/users/vishr/following{/other_user}","gists_url":"https://api.github.com/users/vishr/gists{/gist_id}","starred_url":"https://api.github.com/users/vishr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishr/subscriptions","organizations_url":"https://api.github.com/users/vishr/orgs","repos_url":"https://api.github.com/users/vishr/repos","events_url":"https://api.github.com/users/vishr/events{/privacy}","received_events_url":"https://api.github.com/users/vishr/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2016-04-07T21:53:29Z","updated_at":"2016-04-09T21:16:33Z","closed_at":"2016-04-09T21:03:46Z","body":"Hi,\r\n\r\nI have some some simple code, like this:\r\n\r\n```\r\nfunc main() {\r\n\te := echo.New()\r\n\r\n\t// Log all requests.\r\n\te.Use(middleware.Logger())\r\n\r\n\t// Add the Github Callback route for clients with OAuth\r\n\te.Get(\"/auth/github/callback\", apiauth.GithubOauthCallback)\r\n\r\n\t// Add a Group of requests that are secured with the GithubOauthMiddleware.\r\n\t// All requests must either have a valid signed session cookie, or are\r\n\t// able to create one by going through the OAuth flow.\r\n\tauthenticated := e.Group(\"/*\", apiauth.GithubOauthMiddleware)\r\n\r\n\t// Add the static assets handler. Anything that falls through to the\r\n\t// `assets` function is a 404.\r\n\tauthenticated.Get(\"/\", assets, middleware.Static(\"assets\"))\r\n\r\n\t// Add the Riemann query handler.\r\n\tauthenticated.Put(\"/query\", staticQuery)\r\n\r\n\t// Live Query\r\n\tauthenticated.Get(\"/query/live\", standard.WrapHandler(websocket.Handler(liveQuery)))\r\n\r\n\t// Actually run the API.\r\n\te.Run(standard.New(\":8080\"))\r\n}\r\n```\r\n\r\nFor the purposes of this bug report, assume all routes have implemented handlers and that the middleware works in a sane way.\r\n\r\nWhen I have the `authenticated.Get(\"/query/live\", standard.WrapHandler(websocket.Handler(liveQuery)))` line in my app, *no* requests over HTTP work - not even to totally separate routes. I can't really understand why this is, but no matter what, every request says \"not websocket protocol\". Instead, I expected websockets to only apply to requests with the route `/query/live`, and everything else to work over HTTP.\r\n\r\nConversely, I know this is possible in Go in General, as the example code here: https://github.com/golang-samples/websocket/blob/master/simple/main.go works as I expect.\r\n\r\nHelp? Am I doing something wrong? I followed the recipe/example here: https://labstack.com/echo/recipes/websocket/"},"comment":{"url":"https://api.github.com/repos/labstack/echo/issues/comments/207855126","html_url":"https://github.com/labstack/echo/issues/457#issuecomment-207855126","issue_url":"https://api.github.com/repos/labstack/echo/issues/457","id":207855126,"user":{"login":"bmhatfield","id":1119967,"avatar_url":"https://avatars.githubusercontent.com/u/1119967?v=3","gravatar_id":"","url":"https://api.github.com/users/bmhatfield","html_url":"https://github.com/bmhatfield","followers_url":"https://api.github.com/users/bmhatfield/followers","following_url":"https://api.github.com/users/bmhatfield/following{/other_user}","gists_url":"https://api.github.com/users/bmhatfield/gists{/gist_id}","starred_url":"https://api.github.com/users/bmhatfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmhatfield/subscriptions","organizations_url":"https://api.github.com/users/bmhatfield/orgs","repos_url":"https://api.github.com/users/bmhatfield/repos","events_url":"https://api.github.com/users/bmhatfield/events{/privacy}","received_events_url":"https://api.github.com/users/bmhatfield/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T21:16:33Z","updated_at":"2016-04-09T21:16:33Z","body":"Whoa. That's amazing. Thank you for doing such an in-depth change here!\r\n\r\nI'll try this out locally soon :-)"}}