{"id":22865651,"url":"https://github.com/jacek-marchwicki/javawebsocketclient","last_synced_at":"2025-09-01T09:38:38.591Z","repository":{"id":9714351,"uuid":"11668780","full_name":"jacek-marchwicki/JavaWebsocketClient","owner":"jacek-marchwicki","description":"RxJava WebSocket library for Java and Android","archived":false,"fork":false,"pushed_at":"2019-02-26T11:58:52.000Z","size":6326,"stargazers_count":192,"open_issues_count":3,"forks_count":34,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-05T15:19:13.623Z","etag":null,"topics":["android","java","okhttp","reactive","rxjava","websocket","websocket-connection","websockets","websockets-rxjava"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacek-marchwicki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-25T19:11:19.000Z","updated_at":"2024-12-08T15:21:09.000Z","dependencies_parsed_at":"2022-08-25T21:10:31.276Z","dependency_job_id":null,"html_url":"https://github.com/jacek-marchwicki/JavaWebsocketClient","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jacek-marchwicki/JavaWebsocketClient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacek-marchwicki%2FJavaWebsocketClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacek-marchwicki%2FJavaWebsocketClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacek-marchwicki%2FJavaWebsocketClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacek-marchwicki%2FJavaWebsocketClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacek-marchwicki","download_url":"https://codeload.github.com/jacek-marchwicki/JavaWebsocketClient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacek-marchwicki%2FJavaWebsocketClient/sbom","scorecard":{"id":500341,"data":{"date":"2025-08-11","repo":{"name":"github.com/jacek-marchwicki/JavaWebsocketClient","commit":"a6beec67ce611caa234eef3ed1dc341126ffffb7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: websockets-server/Dockerfile:1: pin your Docker image by updating python:2.7.10 to python:2.7.10@sha256:a11ab9a16bf6853c9c1134fd78ca1abe11e55ab4fe30eb5dffd688a58e7b5899","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T21:40:34.110Z","repository_id":9714351,"created_at":"2025-08-19T21:40:34.110Z","updated_at":"2025-08-19T21:40:34.110Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273100760,"owners_count":25045700,"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-09-01T02:00:09.058Z","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":["android","java","okhttp","reactive","rxjava","websocket","websocket-connection","websockets","websockets-rxjava"],"created_at":"2024-12-13T11:38:18.975Z","updated_at":"2025-09-01T09:38:38.568Z","avatar_url":"https://github.com/jacek-marchwicki.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaWebsocketClient also for Android\nJavaWebsocketClient is library is simple library for Websocket connection in rx for java and Android.\nIt is designed to be fast and fault tolerant.\n\nCurrently we use okhttp3 for websocket connection because okhttp3 is simple and well tested solution.\n\n[![Build Status](https://travis-ci.org/jacek-marchwicki/JavaWebsocketClient.svg?branch=master)](https://travis-ci.org/jacek-marchwicki/JavaWebsocketClient)\n\n[![Release](https://jitpack.io/v/jacek-marchwicki/JavaWebsocketClient.svg)](https://jitpack.io/#jacek-marchwicki/JavaWebsocketClient)\n\n![Presentation of example](imgs/presentation.gif)\n\n## Content of the package\n\n* Example websockets server [python twisted server](websockets-server/README.md)\n* Rx-java websocket client library `websockets-rxjava/`\n* Rx-java websocket android example `websockets-rxjava-example/`\n\n## Reactive example\n\nHow to connect to server:\n\n```java\nfinal Request request = new Request.Builder()\n        .get()\n        .url(\"ws://10.10.0.2:8080/ws\")\n        .build();\nfinal Subscription subscribe = new RxWebSockets(new OkHttpClient(), request)\n        .webSocketObservable()\n        .subscribe(new Action1\u003cRxEvent\u003e() {\n            @Override\n            public void call(RxEvent rxEvent) {\n                System.out.println(\"Event: \" + rxEvent.toString());\n            }\n        });\nThread.sleep(10000);\nsubscribe.unsubscribe();\n```\n\nSend message on connected:\n\n```java\nfinal Subscription subscription = new RxWebSockets(newWebSocket, request)\n        .webSocketObservable()\n        .subscribe(new Action1\u003cRxEvent\u003e() {\n            @Override\n            public void call(RxEvent rxEvent) {\n                if (rxEvent instanceof RxEventConnected) {\n                    Observable.just(\"response\")\n                            .compose(RxMoreObservables.sendMessage((RxEventConnected) rxEvent))\n                            .subscribe();\n                }\n            }\n        });\nThread.sleep(1000);\nsubscription.unsubscribe();\n```\n\nFor examples look:\n* Android example: [Activity](websockets-rxjava-example/src/main/java/com/appunite/socket/MainActivity.java) [Presenter](websockets-rxjava-example/src/main/java/com/appunite/socket/MainPresenter.java)\n* Example Real tests: [RxJsonWebSocketsRealTest](websockets-rxjava-example/src/test/java/com/example/RxObjectWebSocketsRealTest.java), [RxWebSocketsRealTest](websockets-rxjava-example/src/test/java/com/example/RxWebSocketsRealTest.java), [SocketRealTest](websockets-rxjava-example/src/test/java/com/example/SocketRealTest.java)\n* [Unit test](websockets-rxjava-example/src/test/java/com/example/SocketTest.java)\n\n## Rx-java with json parser\n\n```java\nclass YourMessage {\n    public String response;\n    public String error;\n}\n\nfinal Request request = new Request.Builder()\n        .get()\n        .url(\"ws://10.10.0.2:8080/ws\")\n        .build();\nfinal RxWebSockets rxWebSockets = new RxWebSockets(new OkHttpClient(), request)\nfinal ObjectSerializer serializer = new GsonObjectSerializer(new Gson(), Message.class)\nfinal RxObjectWebSockets webSockets = new RxObjectWebSockets(rxWebSockets), serializer);\nfinal Subscription subscription = webSockets.webSocketObservable()\n        .compose(MoreObservables.filterAndMap(RxObjectEventMessage.class))\n        .compose(RxObjectEventMessage.filterAndMap(YourMessage.class))\n        .subscribe(new Action1\u003cYourMessage\u003e() {\n            @Override\n            public void call(YourMessage yourMessage) {\n                System.out.println(\"your message: \" + yourMessage.response);\n            }\n        });\nThread.sleep(1000);\nsubscription.unsubscribe();\n```\n\n## Run example from gradle\n\nTo run example first run [websocket server](websockets-server/README.md), than update url to your host in:\n* [Rx-java Activity](websockets-rxjava-example/src/main/java/com/appunite/socket/MainActivity.java)\n\n```bash\n./gradlew :websockets-rxjava-example:installDebug\n```\n\n## How to add to your project\n\nto your gradle file:\n\n```groovy\nrepositories {\n    maven { url \"https://jitpack.io\" }\n}\n\ndependencies {\n\n    // snapshot version\n    compile 'com.github.jacek-marchwicki:JavaWebsocketClient:master-SNAPSHOT'\n\n    // or use specific version\n    compile 'com.github.jacek-marchwicki:JavaWebsocketClient:\u003clook-on-release-tab\u003e'\n}\n```\n\t\t\n## License\n\n    Copyright [2015] [Jacek Marchwicki \u003cjacek.marchwicki@gmail.com\u003e]\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n    \thttp://www.apache.org/licenses/LICENSE-2.0\n        \n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacek-marchwicki%2Fjavawebsocketclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacek-marchwicki%2Fjavawebsocketclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacek-marchwicki%2Fjavawebsocketclient/lists"}