{"id":13902725,"url":"https://github.com/alex8088/node-signalr","last_synced_at":"2025-04-09T16:20:43.437Z","repository":{"id":45986812,"uuid":"193086656","full_name":"alex8088/node-signalr","owner":"alex8088","description":" A signalR client for node.js which support ASP.net but not ASP.net Core.","archived":false,"fork":false,"pushed_at":"2024-11-11T15:40:50.000Z","size":53,"stargazers_count":22,"open_issues_count":1,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T04:01:53.646Z","etag":null,"topics":["nodejs","signalr","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex8088.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-21T11:28:05.000Z","updated_at":"2024-11-11T15:40:04.000Z","dependencies_parsed_at":"2024-01-16T23:30:50.614Z","dependency_job_id":"632d11c3-df4c-455c-a0a4-5758177f8927","html_url":"https://github.com/alex8088/node-signalr","commit_stats":{"total_commits":24,"total_committers":3,"mean_commits":8.0,"dds":0.5,"last_synced_commit":"b33b65c8340809a153421e8ec354db608391f10a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fnode-signalr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fnode-signalr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fnode-signalr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fnode-signalr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex8088","download_url":"https://codeload.github.com/alex8088/node-signalr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"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":["nodejs","signalr","websocket"],"created_at":"2024-08-06T22:01:20.781Z","updated_at":"2025-04-09T16:20:43.396Z","avatar_url":"https://github.com/alex8088.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# node-signalr\n\nA signalR client for node.js which support ASP.net but not ASP.net Core. For ASP.net Core signalR support use the offical client from Microsoft.\n\n## Install\n\n```bash\n$ npm i node-signalr\n```\n\n## Usage\n\n### Create a SignalR Client Instance\n\n```ts\nimport signalr from 'node-signalr'\n\nconst client = new signalr.Client('http://localhost:8080/signalr', ['testHub'])\n```\n\n### Configuring Client\n\n```js\n// custom headers\nclient.headers['Token'] = 'Tds2dsJk'\n\n// set timeout for sending message\nclient.callTimeout = 10000 // 10's, default 5000\n\n// set delay time for reconecting\nclient.reconnectDelayTime = 2000 // 2's, default 5000\n\n// set timeout for connect\nclient.requestTimeout = 2000 // 2's, default 5000\n```\n\n### Binding Client Events\n\n```ts\nclient.on('connected', () =\u003e {\n  console.log('SignalR client connected.')\n})\nclient.on('reconnecting', (retryCount) =\u003e {\n  console.log(`SignalR client reconnecting(${retryCount}).`)\n})\nclient.on('disconnected', (reason) =\u003e {\n  console.log(`SignalR client disconnected(${reason}).`)\n})\nclient.on('error', (error) =\u003e {\n  console.log(`SignalR client connect error: ${error.code}.`)\n})\n```\n\n### Binding Hub Method\n\n- Bind callback for receive message\n\n```js\nclient.connection.hub.on('testHub', 'getMessage', (message) =\u003e {\n  console.log('receive:', message)\n})\n```\n\n- Call the hub method and get return values asynchronously\n\n```ts\nconst message = { user: '', message: '' }\n\nclient.connection.hub\n  .call('testHub', 'send', message)\n  .then((result) =\u003e {\n    console.log('success:', result)\n  })\n  .catch((error) =\u003e {\n    console.log('error:', error)\n  })\n```\n\n- Invoke the hub method without return values\n\n```ts\nconst message = { user: '', message: '' }\n\nclient.connection.hub.invoke('testHub', 'send', message)\n```\n\n### Start Client\n\n```ts\nclient.start()\n```\n\n### End Client\n\n```ts\nclient.end()\n```\n\n## Powered By\n\n- [ws](https://github.com/websockets/ws)\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex8088%2Fnode-signalr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex8088%2Fnode-signalr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex8088%2Fnode-signalr/lists"}