{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/2894","repository_url":"https://api.github.com/repos/eclipse/jetty.project","labels_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2894/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2894/comments","events_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2894/events","html_url":"https://github.com/eclipse/jetty.project/issues/2894","id":358532768,"node_id":"MDU6SXNzdWUzNTg1MzI3Njg=","number":2894,"title":"How to keep identify information in a websocket ?","user":{"login":"scorsi","id":8389441,"node_id":"MDQ6VXNlcjgzODk0NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/8389441?v=4","gravatar_id":"","url":"https://api.github.com/users/scorsi","html_url":"https://github.com/scorsi","followers_url":"https://api.github.com/users/scorsi/followers","following_url":"https://api.github.com/users/scorsi/following{/other_user}","gists_url":"https://api.github.com/users/scorsi/gists{/gist_id}","starred_url":"https://api.github.com/users/scorsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scorsi/subscriptions","organizations_url":"https://api.github.com/users/scorsi/orgs","repos_url":"https://api.github.com/users/scorsi/repos","events_url":"https://api.github.com/users/scorsi/events{/privacy}","received_events_url":"https://api.github.com/users/scorsi/received_events","type":"User","site_admin":false},"labels":[{"id":350154659,"node_id":"MDU6TGFiZWwzNTAxNTQ2NTk=","url":"https://api.github.com/repos/eclipse/jetty.project/labels/Question","name":"Question","color":"006b75","default":false}],"state":"open","locked":false,"assignee":{"login":"joakime","id":191721,"node_id":"MDQ6VXNlcjE5MTcyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/191721?v=4","gravatar_id":"","url":"https://api.github.com/users/joakime","html_url":"https://github.com/joakime","followers_url":"https://api.github.com/users/joakime/followers","following_url":"https://api.github.com/users/joakime/following{/other_user}","gists_url":"https://api.github.com/users/joakime/gists{/gist_id}","starred_url":"https://api.github.com/users/joakime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakime/subscriptions","organizations_url":"https://api.github.com/users/joakime/orgs","repos_url":"https://api.github.com/users/joakime/repos","events_url":"https://api.github.com/users/joakime/events{/privacy}","received_events_url":"https://api.github.com/users/joakime/received_events","type":"User","site_admin":false},"assignees":[{"login":"joakime","id":191721,"node_id":"MDQ6VXNlcjE5MTcyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/191721?v=4","gravatar_id":"","url":"https://api.github.com/users/joakime","html_url":"https://github.com/joakime","followers_url":"https://api.github.com/users/joakime/followers","following_url":"https://api.github.com/users/joakime/following{/other_user}","gists_url":"https://api.github.com/users/joakime/gists{/gist_id}","starred_url":"https://api.github.com/users/joakime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakime/subscriptions","organizations_url":"https://api.github.com/users/joakime/orgs","repos_url":"https://api.github.com/users/joakime/repos","events_url":"https://api.github.com/users/joakime/events{/privacy}","received_events_url":"https://api.github.com/users/joakime/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-09-10T09:08:28Z","updated_at":"2018-09-10T16:37:09Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm creating a websocket-only server using `jetty-websocket-servlet`.\r\nI've successfuly written a echo server.\r\n\r\nI'm writting a protocol over websocket for my application, the first step is to authenticate the user, to do so, the client sends its connection information over the websocket and the server authorize it using a H2 database or close the connection if information are invalide or if the first message is not a AUTH one.\r\nBut now, I'm asking how to keep in the websocket session the user id after authentication.\r\n\r\nShould I use information in the `session.remote.inetSocketAddress` and retrieve the user information thanks to a in-memory cache system ?\r\nShould I create a `userId` directly in my class extending `org.eclipse.jetty.websocket.api.WebSocketAdapter/WebSocketListener` ?\r\nShould I use `javax.websocket` with Jetty (as in https://github.com/jetty-project/embedded-jetty-websocket-examples/tree/master/javax.websocket-example) to have a `sessionId` directly on my session object ?\r\n\r\nWhat of thoses solutions are the more fast, reliable and secure ?\r\n\r\nThank you,\r\nscorsi,"},"comment":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/comments/419978244","html_url":"https://github.com/eclipse/jetty.project/issues/2894#issuecomment-419978244","issue_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2894","id":419978244,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTk3ODI0NA==","user":{"login":"sbordet","id":414681,"node_id":"MDQ6VXNlcjQxNDY4MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/414681?v=4","gravatar_id":"","url":"https://api.github.com/users/sbordet","html_url":"https://github.com/sbordet","followers_url":"https://api.github.com/users/sbordet/followers","following_url":"https://api.github.com/users/sbordet/following{/other_user}","gists_url":"https://api.github.com/users/sbordet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbordet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbordet/subscriptions","organizations_url":"https://api.github.com/users/sbordet/orgs","repos_url":"https://api.github.com/users/sbordet/repos","events_url":"https://api.github.com/users/sbordet/events{/privacy}","received_events_url":"https://api.github.com/users/sbordet/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T16:37:09Z","updated_at":"2018-09-10T16:37:09Z","author_association":"CONTRIBUTOR","body":"@scorsi CometD does not handle TCP/UDP.\r\n\r\nWHat CometD does is just what you are doing: implementing a protocol on top of WebSocket (and HTTP).\r\n\r\nYou will realize soon that you don't need just one thing, but you will need authentication, you will need some sort of heartbeat to handle clients that \"disappear\", you will need \"channels\" so that clients can publish message to a channel and receive messages only when subscribed to that channel, you will need a way to batch messages, you will need a way to disconnect (from the client and from the server), you will need a way to secure the whole thing so that players cannot cheat by reverse engineering the protocol, you will need a way to guarantee the delivery and possibly the order of messages, etc.\r\nThat is what CometD does.\r\n\r\nGood luck!"}}
{"actor":{"display_login":"sbordet"}}