{"id":19795407,"url":"https://github.com/itemconsulting/lib-xp-wsutil","last_synced_at":"2025-10-03T23:47:36.114Z","repository":{"id":56026704,"uuid":"105000602","full_name":"ItemConsulting/lib-xp-wsutil","owner":"ItemConsulting","description":"Server side web socket utility library","archived":false,"fork":false,"pushed_at":"2021-04-28T11:40:57.000Z","size":975,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-02-28T16:08:30.812Z","etag":null,"topics":["enonic-xp","websockets","xp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItemConsulting.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}},"created_at":"2017-09-27T09:41:13.000Z","updated_at":"2021-05-27T09:14:52.000Z","dependencies_parsed_at":"2022-08-15T11:40:41.879Z","dependency_job_id":null,"html_url":"https://github.com/ItemConsulting/lib-xp-wsutil","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ItemConsulting/lib-xp-wsutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItemConsulting%2Flib-xp-wsutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItemConsulting%2Flib-xp-wsutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItemConsulting%2Flib-xp-wsutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItemConsulting%2Flib-xp-wsutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItemConsulting","download_url":"https://codeload.github.com/ItemConsulting/lib-xp-wsutil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItemConsulting%2Flib-xp-wsutil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278245374,"owners_count":25955013,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"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":["enonic-xp","websockets","xp"],"created_at":"2024-11-12T07:16:17.489Z","updated_at":"2025-10-03T23:47:36.075Z","avatar_url":"https://github.com/ItemConsulting.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enonic XP web socket utility library #\n\n[![](https://jitpack.io/v/no.item/lib-xp-wsutil.svg)](https://jitpack.io/#no.item/lib-xp-wsutil)\n\n## Dependencies\n\nAdd the repository and dependencies in your *build.gradle* file\n\n```groovy\nrepositories {\n  maven { url 'https://jitpack.io' }\n}\n\ndependencies {\n  include \"com.enonic.xp:lib-portal:${xpVersion}\"\n  include \"com.enonic.xp:lib-io:${xpVersion}\"\n  include \"com.enonic.xp:lib-websocket:${xpVersion}\"\n  include \"no.item:lib-xp-wsutil:2.0.0\"\n}\n```\n\n## Documentation ##\n\nGo [here](https://itemconsulting.github.io/lib-xp-wsutil/) for documentation\n\n## Versions ##\n\n### 2.0.0 ###\n\n* Turn of logging by setting `no.item.wsUtils.printLog` to `false` in the config file for the project using this lib.\n* Upgraded to build on XP 7.5.0.\n* Compatibility Enonic XP 7.5.0.\n\n### 1.1.1 ###\n\n* Added ```getWsEvents``` method to improve reusability\n\n### 1.0.0 ###\n * Initital release\n\nCompatibility Enonic XP 6.4.0\n\n\n\n\n## Files included ##\n\n```\nsrc/\n   |- main/\n          |- resources/\n                      |- assets/\n                      |        |- clientws.js // Client side library\n                      |- lib/\n                            |- virtual.js // Virtual documentation file\n                            |- wsUtils.js // Server side library\n```\n\n## Hello sockets ##\n\nHere is the shortest example for opening websocket communication in your project\n\n```html\n\u003c!-- Add these tags to your html for page part etc.. --\u003e\n\u003cscript src=\"mysite/_/service/com.my.app/websocket\"\u003e\u003c/script\u003e\n\u003cscript src=\"mysite/_/asset/com.my.app/clientws.js\"\u003e\u003c/script\u003e\n\n```\n```javascript\n// Create a service called websocket\nvar ws = require('/lib/wsUtil');\nws.openWebsockets(exports);\n```\n```javascript\n// Create an asset called clientws.js\nvar clientWs = new ExpWS();\nclientWs.connect();\n```\nCheck the console/server logs to see that your connection is alive\n\n## License ##\n\nThis project is under the Apache 2.0 license. For more information please read [LICENSE.txt](LICENSE)\n\n\n## Author ##\n\n**Per Arne Drevland** *Consultant* [Item Consulting AS](https://item.no)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitemconsulting%2Flib-xp-wsutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitemconsulting%2Flib-xp-wsutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitemconsulting%2Flib-xp-wsutil/lists"}