{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/19945","repository_url":"https://api.github.com/repos/akka/akka","labels_url":"https://api.github.com/repos/akka/akka/issues/19945/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/19945/comments","events_url":"https://api.github.com/repos/akka/akka/issues/19945/events","html_url":"https://github.com/akka/akka/issues/19945","id":138333697,"number":19945,"title":"Akka Streams WebSocket times out","user":{"login":"roldugin","id":749698,"avatar_url":"https://avatars.githubusercontent.com/u/749698?v=3","gravatar_id":"","url":"https://api.github.com/users/roldugin","html_url":"https://github.com/roldugin","followers_url":"https://api.github.com/users/roldugin/followers","following_url":"https://api.github.com/users/roldugin/following{/other_user}","gists_url":"https://api.github.com/users/roldugin/gists{/gist_id}","starred_url":"https://api.github.com/users/roldugin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roldugin/subscriptions","organizations_url":"https://api.github.com/users/roldugin/orgs","repos_url":"https://api.github.com/users/roldugin/repos","events_url":"https://api.github.com/users/roldugin/events{/privacy}","received_events_url":"https://api.github.com/users/roldugin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-03T23:55:22Z","updated_at":"2016-03-04T01:43:59Z","closed_at":null,"body":"After upgrading to `Akka Streams 2.0.3` from `1.0` I see that the WebSocket connection times out after 1.1 minutes of inactivity.\r\n\r\nI was able to reproduce it with with the example program from the docs:\r\nhttps://github.com/akka/akka/blob/akka-stream-and-http-experimental-2.0.3/akka-docs-dev/rst/scala/code/docs/http/scaladsl/server/WebsocketExampleSpec.scala\r\n\r\nFor the above program a workaround is to add the following step to `greeterWebsocketService`:\r\n```scala\r\n.keepAlive(30.seconds, () => TextMessage(\"keepalive\"))\r\n```"},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/192051410","html_url":"https://github.com/akka/akka/issues/19945#issuecomment-192051410","issue_url":"https://api.github.com/repos/akka/akka/issues/19945","id":192051410,"user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T01:43:59Z","updated_at":"2016-03-04T01:43:59Z","body":"Hi there, and while it may sound a bit weird: It's a feature, not a bug – really.\r\nThis is configured by the `akka.http.server.idle-timeout` setting, and does as expected: if nothing happens on a connection got over a minute, the connection should be torn down – this is to prevent a gazillion clients from connecting and not ever doing anything, thus using up your resources and killing the server eventually.\r\n\r\nConfigure the idle-timeout to suit your needs (read the docs around it please) or inject a keepAlive indeed – those are the exact two solutions we recomment"}}