{"id":15352264,"url":"https://github.com/isapir/lucee-websocket","last_synced_at":"2025-04-15T05:52:00.004Z","repository":{"id":19065497,"uuid":"85861793","full_name":"isapir/lucee-websocket","owner":"isapir","description":"Enables server WebSockets for Lucee via JSR-356 compliant servlet containers (e.g. Tomcat 8, Jetty 9.1, etc.)","archived":false,"fork":false,"pushed_at":"2022-01-20T16:49:47.000Z","size":65,"stargazers_count":18,"open_issues_count":18,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-15T05:51:55.187Z","etag":null,"topics":["java","lucee","lucee-server","websocket-server","websockets"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"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/isapir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-22T18:20:42.000Z","updated_at":"2024-07-28T03:17:48.000Z","dependencies_parsed_at":"2022-08-07T09:01:06.263Z","dependency_job_id":null,"html_url":"https://github.com/isapir/lucee-websocket","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isapir%2Flucee-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isapir%2Flucee-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isapir%2Flucee-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isapir%2Flucee-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isapir","download_url":"https://codeload.github.com/isapir/lucee-websocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016317,"owners_count":21198832,"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":["java","lucee","lucee-server","websocket-server","websockets"],"created_at":"2024-10-01T12:09:08.319Z","updated_at":"2025-04-15T05:51:59.989Z","avatar_url":"https://github.com/isapir.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Requirements\r\n\r\n* Java 8\r\n* JSR-356 Compliant Servlet Container, e.g. Tomcat 8, Jetty 9.1, etc.\r\n* Lucee 5.1.3.18\r\n\r\n## Installation \r\n\r\n## Update July 14th, 2017\r\n\r\nVersion 2.0.1 is out, and it fixes major issues but also adds to the installation process a bit.  The new installation process is as follows:\r\n\r\n- If a previous version of the extension is installed -- Uninstall it\r\n- Install the extension from the Admin or by downloading the `.lex` file and dropping it in the `deploy` directory\r\n- Save the jar file `servlet-filter-utils-1.1.1.jar` to the classpath, e.g. if you're using Tomcat it can go into `{tomcat}/lib`, or if you're using Jetty then it can go into `{jetty}/lib/ext`\r\n- Add the following snippet to your web deployment descriptor (web.xml), **be sure to modify the `url-pattern` to match your URLs that will used with WebSockets**:\r\n\r\n```xml\r\n    \u003c!-- Required for the Lucee WebSocket Extension !--\u003e    \r\n    \u003cfilter\u003e\r\n      \u003cfilter-name\u003eHttpSessionInitializerFilter\u003c/filter-name\u003e\r\n      \u003cfilter-class\u003enet.twentyonesolutions.servlet.filter.HttpSessionInitializerFilter\u003c/filter-class\u003e\r\n    \u003c/filter\u003e\r\n\r\n    \u003cfilter-mapping\u003e\r\n      \u003cfilter-name\u003eHttpSessionInitializerFilter\u003c/filter-name\u003e\r\n      \u003c!-- modify url-pattern to match your websocket endpoints !--\u003e\r\n      \u003curl-pattern\u003e/ws/*\u003c/url-pattern\u003e\r\n    \u003c/filter-mapping\u003e\r\n```\r\n\r\n- Restart the Servlet Container (e.g. Tomcat, Jetty, etc.)\r\n\r\n### Breaking Change\r\nThe function `WebsocketRegister()` has been renamed to `WebsocketServer()`.  I hope to add a `WebsocketClient()` function soon so I wanted the names to make sense.\r\n\r\n---\r\n\r\nThe easiest way to install the extension is from the Lucee Admin.  Navigate to the Extension Applications page in the Web or Server Admin, e.g. `/lucee/admin/server.cfm?action=ext.applications`.  Click the *Lucee Websockets Extension* icon, and then on the next page click the `Install` button.\r\n\r\n## Getting Started\r\n\r\nThe WebSocket API is event driven, meaning that you register event handling methods (e.g. _onOpen()_, _onMessage()_, etc), and those are called when the corresponding events are triggered.\r\n\r\nTo configure a WebSocket endpoint call the function \r\n\r\n    WebsocketRegister(String endpoint, Component listener):ConnectionManager\r\n    \r\nWhere `endpoint` is the URI for the incoming WebSocket connections, e.g. `/ws/chat/{channel}`, and the Component listener is a component that implements any of the event handling methods as specified in the [Listener Component API](../../wiki/Listener-Component-API).\r\n    \r\nThis should only be done once, so you can do that in Application.cfc's onApplicationStart().\r\n\r\nEach _endpoint_ has its own [ConnectionManager](../../wiki/ConnectionManager-API) object, which keeps track of all of the client WebSockets that are connected to that _endpoint_.  You can either store the _ConnectionManager_ in an Application scope variable, or retrieve it from a [WebSocket](wiki/WebSocket-API) object that is passed as as argument to some of the event handlers by calling the method _getConnectionManager()_ on that argument, i.e. `arguments.websocket.getConnectionManager()`.\r\n\r\n## Documentation and Tutorials\r\n\r\nCheck the [WIKI](../../wiki) for reference and documentation\r\n\r\nWatch Getting Started Video Tutorial at:\r\n\r\n[![Getting Started with Lucee WebSockets](http://img.youtube.com/vi/r2s2kGQVZqg/0.jpg)](http://www.youtube.com/watch?v=r2s2kGQVZqg \"Lucee WebSockets - Getting Started\")\r\n\r\nWatch Chat Server Example Video Tutorial at:\r\n\r\n[![Chat Server Example Video](http://img.youtube.com/vi/rvB7PcNylVY/0.jpg)](http://www.youtube.com/watch?v=rvB7PcNylVY \"Lucee WebSockets - Getting Started\")\r\n\r\n## Discussion\r\n\r\nPlease use [Lucee Websockets Extension on Lucee Dev](https://dev.lucee.org/t/lucee-websockets-extension/2067)\r\n\r\n## Copyright / License\r\n\r\nCopyright 2016-2017 Igal Sapir\r\n\r\nThis software is licensed under the Lesser GNU General Public License Version 2.1 (or later); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:\r\n[http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt)\r\n\r\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisapir%2Flucee-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisapir%2Flucee-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisapir%2Flucee-websocket/lists"}