{"id":18965349,"url":"https://github.com/sony/micro-notifier","last_synced_at":"2025-04-19T12:51:39.733Z","repository":{"id":54487802,"uuid":"293236811","full_name":"sony/micro-notifier","owner":"sony","description":"Simplified Pusher Clone","archived":false,"fork":false,"pushed_at":"2023-05-05T09:10:33.000Z","size":51,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T08:04:42.853Z","etag":null,"topics":["golang","microservice","pusher","server","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/sony.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":"2020-09-06T08:43:07.000Z","updated_at":"2024-12-29T11:17:59.000Z","dependencies_parsed_at":"2024-06-19T06:17:46.410Z","dependency_job_id":"3c2ef841-56ae-4a24-bb3c-ae94715ad076","html_url":"https://github.com/sony/micro-notifier","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"ebd5dae3752a66a5d951de42bb345d8d4fd4ae56"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fmicro-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fmicro-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fmicro-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fmicro-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sony","download_url":"https://codeload.github.com/sony/micro-notifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249201117,"owners_count":21229004,"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":["golang","microservice","pusher","server","websocket"],"created_at":"2024-11-08T14:29:00.585Z","updated_at":"2025-04-16T05:32:28.373Z","avatar_url":"https://github.com/sony.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MicroNotifier - Simplified Pusher Clone\n\n## Overview\n\nMicroNotifier is a simple event multicaster:\nYou can push events to multiple Web browsers via WebSocket.\nThe protocol is a subset of Pusher, so you can use Pusher's client libraries.\n\nMicroNotifier can run either *standalone* mode or *distributed* mode.\nIn the standalone mode, you just run a single notifier process\nand it handles everything.\n\nIf a single process is not enough to deal with the amount of communication,\nyou can scale it up by running multiple notifier processes in the distributed mode.\nWith this mode, notifiers communicate each other via Redis server.\nYou have to run Redis server and a load balancer on your own.\n\nThe mode can be specified by the configuration file, which is explained below.\n\n\n## Configuration\n\nMicroNotifier's configuration file is in JSON, with the following fields recognized.\nSample configuration files can be found under [`config`](config) subdirectory.\n\n- `host`: The server's host name [default: `localhost`]\n- `port`: The server's port number [default: 8111]\n- `certificate`: If you want to use secure connection, specify the path to the server certificate [default: \"\"]\n- `private-key`: If you want to use secure connection, specify the path to the server private key [default: \"\"]\n- `applications`: An array of application definitions. Each application must be the following map:\n  - `name`: Name of the application.\n  - `key`: Application key. A string consists of alphanumeric characters.\n  - `secret`: Application secret. Used to sign subscription requests. A string consists of alphanumeric characters.\n- `redis`: An object that gives the information of Redis server to use in distributed mode.\n  If this option isn't specified, the notifier runs in standalone mode.\n  - `address`: Redis server's hostname; you can also add port number after a colon. Example: `localhost:9375`.\n  - `database`: (Optional) Nonnegative integer to specify the database number to use. [default: 0]\n    \u003e **Note**: Running the unit test with `-tags=redis_test` or `-tags=redis_sentinel_test` erases the database specified by this option.\n    The test script uses database #1 for testing purpose by default.\n    Change `config/sample-redis-test.json` or `config/sample-redis-sentinel-test.json` if you need to use different database.\n  - `password`: (Optional) Redis password, if any.  [default: none]\n  - `sentinel`: (Optional) Use redis server's with [Redis Sentinel](https://redis.io/topics/sentinel) mode. [default: false]\n\nIf `certificate` and `private-key` are given, the server serves with TLS.\nOtherwise, the server serves plain HTTP.\n\nIf `redis` entry is specified, the server runs in distributed mode.\nOtherwise, it runs in standalone mode.\n\n\n## Running\n\nRun binary, passing the path of the configuration file with `-c` option.\n\n\n## Using from Pusher client libraries\n\nYou can find examples under [`samples`](samples) subdirectory.\n\n### From pusher-http-go\n\nWhen initializing `pusher.Client`, pass the application name as `AppID` and the key as `Key`.\nYou should specify the host name and the port number by `Host` (otherwise it'll connect to the official pusher server).\n\nExample:\n\n```go\n\tclient := pusher.Client{\n\t\tAppID:   \"testapp\",\n\t\tKey:     \"1234567890\",\n\t\tSecret:  \"donttellanybody\",\n\t\tHost:    \"localhost:8150\",\n\t}\n```\n\n### From pusher.js\n\nWhen initializing `Pusher`, pass the host name and the port number as `wsHost` and `wsPort` respectively.\n\nExample:\n\n```js\n    var pusher = new Pusher('1234567890', {\n      wsHost: 'localhost',\n      wsPort: 8150,\n    });\n```\n\n\n## Testing\n\nTo run the unit test in full, you need Chrome and Redis server installed on the test machine.\nBy default, `go test` just runs the tests that don't require Chrome nor Redis, but they are very limited.\nYou can give the following build tags to cover the rest of the tests:\n\n- `chrome_test` includes tests using `Chrome` subprocess via `chromedp`.\n- `redis_test` includes tests using Redis server. You have to tweak `config/sample-redis-test.json`\n   to match your Redis server configuration.\n- `redis_sentinel_test` includes tests using Redis Sentinel cluster. You have to tweak `config/sample-redis-sentinel-test.json`\n   to match your Redis Sentinel cluster configuration.\n\nThe following command runs the full test:\n\n```text\ngo test -tags=\"chrome_test redis_test\" ./... ; go test -tags=redis_sentinel_test ./...\n```\n\n\n## License\n\nThe MIT License (MIT)\n\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsony%2Fmicro-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsony%2Fmicro-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsony%2Fmicro-notifier/lists"}