{"id":20136210,"url":"https://github.com/lucee/extension-websocket","last_synced_at":"2026-06-05T06:31:25.687Z","repository":{"id":226673515,"uuid":"769075447","full_name":"lucee/extension-websocket","owner":"lucee","description":"Lucee Websocket Extension","archived":false,"fork":false,"pushed_at":"2026-04-17T23:36:17.000Z","size":18184,"stargazers_count":0,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-04-18T00:37:14.152Z","etag":null,"topics":["cfml","lucee","websockets"],"latest_commit_sha":null,"homepage":"https://docs.lucee.org/recipes/websocket-extension.html","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"License.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-03-08T09:43:43.000Z","updated_at":"2026-04-17T22:46:38.000Z","dependencies_parsed_at":"2024-11-07T11:32:17.091Z","dependency_job_id":"5bd6eee9-645a-4d6b-94aa-1f548182046f","html_url":"https://github.com/lucee/extension-websocket","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"20edbc6437bab1b11e59b5bfec955add4722201f"},"previous_names":["lucee/extension-websocket"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lucee/extension-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucee%2Fextension-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucee%2Fextension-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucee%2Fextension-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucee%2Fextension-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucee","download_url":"https://codeload.github.com/lucee/extension-websocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucee%2Fextension-websocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33932048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cfml","lucee","websockets"],"created_at":"2024-11-13T21:18:08.879Z","updated_at":"2026-06-05T06:31:25.678Z","avatar_url":"https://github.com/lucee.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lucee WebSocket Extension\n\n[![Java CI](https://github.com/lucee/extension-websocket/actions/workflows/main.yml/badge.svg)](https://github.com/lucee/extension-websocket/actions/workflows/main.yml)\n\nWebSocket server support for Lucee CFML — define listener components with lifecycle methods (`onOpen`, `onMessage`, `onClose`, etc) and Lucee handles the WebSocket endpoint for you.\n\n**Requires Lucee 6.2+**. Dual API support — loads on both Lucee 6.x (Tomcat 9 / `javax.websocket`) and Lucee 7.x (Tomcat 11 / `jakarta.websocket`).\n\n## Installation\n\nInstall via Lucee Admin, or pin in your environment:\n\n```bash\nLUCEE_EXTENSIONS=org.lucee:websocket-extension:3.0.0.20-SNAPSHOT\n```\n\n## Documentation\n\n- **Docs**: [docs.lucee.org/recipes/websocket-extension.html](https://docs.lucee.org/recipes/websocket-extension.html)\n- **Downloads**: [download.lucee.org](https://download.lucee.org/#3F9DFF32-B555-449D-B0EB5DB723044045)\n- **Issues**: [Lucee JIRA — WebSocket Issues](https://luceeserver.atlassian.net/issues/?jql=labels%20%3D%20%22websockets%22)\n\n### What's Included\n\n- **Listener components** — CFML components with `onOpen`, `onMessage`, `onClose`, `onError`, `onFirstOpen`, `onLastClose` lifecycle methods.\n- **Async open handler** — optional `onOpenAsync` runs in parallel with `onOpen` for long-running init work.\n- **JSR-356 Session access** — `wsClient.getSession()` exposes the underlying `javax.websocket.Session` / `jakarta.websocket.Session` for per-connection state (`getUserProperties()`), connection identity (`getId()`), and handshake data (`getRequestParameterMap()`).\n- **`websocketInfo()` BIF** — returns `version`, `mapping`, `config`, `configFile`, `log`, and an `instances[]` array of active sessions with their component + session metadata.\n- **Extension hot-upgrade** — upgrade the `.lex` in-place via `inject()` without restarting the servlet container.\n- **Configurable timeouts** — `idleTimeout` and `requestTimeout` per web context via `websocket.json`.\n\n## Configuration\n\nListener components live in a directory configured in `{lucee-config}/websocket.json` (auto-created with defaults on first load):\n\n```json\n{\n    \"directory\": \"{lucee-config}/websockets/\",\n    \"requestTimeout\": 50,\n    \"idleTimeout\": 300\n}\n```\n\nOverride the config path with `-Dlucee.websocket.config=/path/to/websocket.json` or the `LUCEE_WEBSOCKET_CONFIG` env var.\n\n## Quick Example\n\nA listener component dropped in the configured directory as `EchoListener.cfc`:\n\n```cfml\ncomponent {\n\n    function onOpen( wsClient ) {\n        wsClient.send( \"CONNECTED\" );\n    }\n\n    function onMessage( wsClient, message ) {\n        wsClient.send( \"ECHO:\" \u0026 message );\n    }\n\n    function onClose( wsClient, reasonPhrase ) {}\n\n    function onError( wsClient, cfCatch ) {\n        systemOutput( \"WS error: #cfCatch.message#\", true );\n    }\n\n}\n```\n\nClients connect to `ws://yourhost/ws/EchoListener`. Check server state:\n\n```cfml\ninfo = websocketInfo();\nwriteDump( info );\n```\n\n## Related\n\n- **[extension-websocket-client](https://github.com/lucee/extension-websocket-client)** — WebSocket client BIFs (`CreateWebSocketClient`) for CFML. This repo's integration tests ([test-websocket-client.cfm](tests/test-websocket-client.cfm), [test-idle-timeout.cfm](tests/test-idle-timeout.cfm)) exercise the full client⇄server loop, so they cover both extensions.\n- **[Lucee-websocket-commandbox](https://github.com/webonix/Lucee-websocket-commandbox)** — full client + server example with JavaScript and CFML.\n- **[CFCAMP 2024 presentation](https://www.cfcamp.org/resource/getting-started-with-lucee-6-websockets.html)** — Getting Started with Lucee 6 WebSockets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucee%2Fextension-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucee%2Fextension-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucee%2Fextension-websocket/lists"}