{"id":36419254,"url":"https://github.com/afrad/angular2-websocket","last_synced_at":"2026-01-11T17:02:17.922Z","repository":{"id":54553568,"uuid":"49329223","full_name":"afrad/angular2-websocket","owner":"afrad","description":"Websocket wrapper for angular2 based on angular-websocket ","archived":false,"fork":false,"pushed_at":"2019-02-12T14:41:45.000Z","size":63,"stargazers_count":208,"open_issues_count":34,"forks_count":84,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-10-21T05:22:09.895Z","etag":null,"topics":["angular","websockets"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/afrad.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":"2016-01-09T15:20:20.000Z","updated_at":"2025-01-03T01:24:08.000Z","dependencies_parsed_at":"2022-08-13T19:30:57.020Z","dependency_job_id":null,"html_url":"https://github.com/afrad/angular2-websocket","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/afrad/angular2-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afrad%2Fangular2-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afrad%2Fangular2-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afrad%2Fangular2-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afrad%2Fangular2-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afrad","download_url":"https://codeload.github.com/afrad/angular2-websocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afrad%2Fangular2-websocket/sbom","scorecard":{"id":169930,"data":{"date":"2025-08-11","repo":{"name":"github.com/afrad/angular2-websocket","commit":"d6d21ec0493a6701fb35741276a9b67db463db64"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":6,"reason":"Found 20/30 approved changesets -- score normalized to 6","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":"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":"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":"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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 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-16T16:09:19.036Z","repository_id":54553568,"created_at":"2025-08-16T16:09:19.036Z","updated_at":"2025-08-16T16:09:19.036Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["angular","websockets"],"created_at":"2026-01-11T17:02:17.850Z","updated_at":"2026-01-11T17:02:17.910Z","avatar_url":"https://github.com/afrad.png","language":"TypeScript","readme":"# angular2websocket\n\nBased on https://github.com/AngularClass/angular-websocket and migrated to Angular2\n## Installation\n\n```bash\nnpm install angular2-websocket\n```\n\n## Usage:\n```ts\nimport {$WebSocket} from 'angular2-websocket/angular2-websocket'\nvar ws = new $WebSocket(\"url\");\nws.send(event);\n\n```\n\nalso\nws.getDataStream() returns Subject\u003cany\u003e to which you can attach an Observer (https://github.com/Reactive-Extensions/RxJS)\n\n## Compilation\n```bash\nnpm run typings\nnpm run compile\n\n```\n\n\nThe default value for binary type is 'arrayBuffer'.\n\n## example\n```ts\nimport {$WebSocket, WebSocketSendMode} from 'angular2-websocket/angular2-websocket';\n  \n// connect\nvar ws = new $WebSocket(\"ws://127.0.0.1:7000\");\n// you can send immediately after connect, \n// data will cached until connect open and immediately send or connect fail.\n  \n// when connect fail, websocket will reconnect or not,\n// you can set {WebSocketConfig.reconnectIfNotNormalClose = true} to enable auto reconnect\n// all cached data will lost when connect close if not reconnect\n  \n  \n// set received message callback\nws.onMessage(\n    (msg: MessageEvent)=\u003e {\n        console.log(\"onMessage \", msg.data);\n    },\n    {autoApply: false}\n);\n  \n// set received message stream\nws.getDataStream().subscribe(\n    (msg)=\u003e {\n        console.log(\"next\", msg.data);\n        ws.close(false);\n    },\n    (msg)=\u003e {\n        console.log(\"error\", msg);\n    },\n    ()=\u003e {\n        console.log(\"complete\");\n    }\n);\n  \n// send with default send mode (now default send mode is Observer)\nws.send(\"some thing\").subscribe(\n        (msg)=\u003e {\n            console.log(\"next\", msg.data);\n        },\n        (msg)=\u003e {\n            console.log(\"error\", msg);\n        },\n        ()=\u003e {\n            console.log(\"complete\");\n        }\n    );\n  \nws.send(\"by default, this will never be sent, because Observer is cold.\");\nws.send(\"by default, this will be sent, because Observer is hot.\").publish().connect();\n  \nws.setSendMode(WebSocketSendMode.Direct);\nws.send(\"this will be sent Direct, because send mode is set to Direct.\");\n  \nws.send(\"this will be sent and return Promise.\", WebSocketSendMode.Promise).then(\n        (T) =\u003e {\n            console.log(\"is send\");\n        },\n        (T) =\u003e {\n            console.log(\"not send\");\n        }\n    );\n  \nws.send(\"this will be sent and return Observer.\").subscribe(\n        (msg)=\u003e {\n            console.log(\"next\", msg.data);\n        },\n        (msg)=\u003e {\n            console.log(\"error\", msg);\n        },\n        ()=\u003e {\n            console.log(\"complete\");\n        }\n    );\n\nws.close(false);    // close\nws.close(true);    // close immediately\n\n\n```\n\n## Binary type\nTo set the binary type for the websocket one can provide it as string in the constructor. Allowed types are:\n\n* 'blob' (default)\n* 'arraybuffer'\n\n```ts\nvar ws = new $WebSocket(\"ws://127.0.0.1:7000\", null, null, 'arraybuffer');\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafrad%2Fangular2-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafrad%2Fangular2-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafrad%2Fangular2-websocket/lists"}