{"id":23338284,"url":"https://github.com/abhirockzz/websocket-http-session","last_synced_at":"2025-04-09T22:31:05.895Z","repository":{"id":79125495,"uuid":"88433352","full_name":"abhirockzz/websocket-http-session","owner":"abhirockzz","description":"How to access HttpSession in WebSocket endpoint","archived":false,"fork":false,"pushed_at":"2017-04-16T18:23:29.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T00:24:34.167Z","etag":null,"topics":["httpsession","javaee7","jsr356","servlet","websocket"],"latest_commit_sha":null,"homepage":"https://abhirockzz.wordpress.com/2017/06/03/accessing-http-session-in-websocket-endpoint/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhirockzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-16T18:11:34.000Z","updated_at":"2018-05-14T14:22:40.000Z","dependencies_parsed_at":"2023-03-13T20:10:55.301Z","dependency_job_id":null,"html_url":"https://github.com/abhirockzz/websocket-http-session","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-http-session","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-http-session/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-http-session/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-http-session/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhirockzz","download_url":"https://codeload.github.com/abhirockzz/websocket-http-session/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123388,"owners_count":21051459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["httpsession","javaee7","jsr356","servlet","websocket"],"created_at":"2024-12-21T03:13:30.389Z","updated_at":"2025-04-09T22:31:05.885Z","avatar_url":"https://github.com/abhirockzz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## To run\r\n\r\n- `git clone` the project and execute `mvn clean install`\r\n- Deploy `websocket-http-session.war` in `target` directory to any of the [Java EE 7 containers](http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html)\r\n\r\n## To check\r\n\r\n- Connect to the WebSocket endpoint `ws://localhost:8080/websocket-http-session/abhi/` (`abhi` is the user). You'll see a [response](https://github.com/abhirockzz/websocket-http-session/blob/master/src/main/java/com/wordpress/abhirockzz/websocket/http_session/Service.java#L21) such as `User abhi | WebSocket session ID 6e4b4986-2f25-4fb7-8a48-d08d8aeec66e | HTTP session ID 7cabd435d20caf3d2a6a1c6a95a4`\r\n- Simulate another user (gitu) `ws://localhost:8080/websocket-http-session/abhi/`. You'll get back details of the HTTP and WebSocket session IDs e.g. `User gitu | WebSocket session ID 8b61fc99-efb7-476b-a12f-2c0d9d432395 | HTTP session ID 7d521c624aaca2127c6331f87253`\r\n\r\n## Test\r\n\r\nYou can also execute a simple test located in the [`test`](https://github.com/abhirockzz/websocket-http-session/blob/master/test/src/test/java/com/wordpress/abhirockzz/websocket/http_session/test/WebSocketEndpointConcurrencyTest.java#L58) project. It's built using the WebSocket client API\r\n\r\n- `cd \u003cdir\u003e\\test`\r\n- `mvn test`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Fwebsocket-http-session","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhirockzz%2Fwebsocket-http-session","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Fwebsocket-http-session/lists"}