{"id":20541825,"url":"https://github.com/hivesolutions/pushi","last_synced_at":"2026-01-08T12:12:35.965Z","repository":{"id":23889876,"uuid":"27269256","full_name":"hivesolutions/pushi","owner":"hivesolutions","description":"Simple yet powerful infra-structure for handling of WebSocket connections","archived":false,"fork":false,"pushed_at":"2024-01-17T15:44:59.000Z","size":598,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-18T07:50:05.549Z","etag":null,"topics":["notifications","push","pushi","realtime","websocket"],"latest_commit_sha":null,"homepage":"http://pushi.hive.pt","language":"Python","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/hivesolutions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2014-11-28T13:59:47.000Z","updated_at":"2024-01-17T09:40:23.000Z","dependencies_parsed_at":"2024-01-17T10:59:26.976Z","dependency_job_id":"1a2dbd33-af7b-4ca9-b6c0-45fda97e2f7c","html_url":"https://github.com/hivesolutions/pushi","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/hivesolutions/pushi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivesolutions%2Fpushi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivesolutions%2Fpushi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivesolutions%2Fpushi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivesolutions%2Fpushi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hivesolutions","download_url":"https://codeload.github.com/hivesolutions/pushi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivesolutions%2Fpushi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260851172,"owners_count":23072551,"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":["notifications","push","pushi","realtime","websocket"],"created_at":"2024-11-16T01:26:35.264Z","updated_at":"2026-01-08T12:12:35.959Z","avatar_url":"https://github.com/hivesolutions.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![Pushi WebSocket](res/logo.png)](http://pushi.hive.pt)\n\nSimple yet powerful infra-structure for handling of WebSocket connections.\n\n## Objectives\n\nThe server itself should be based on a common infra-structure like the one\npresent in frameworks like node.js that should abstract the socket connection\nlayer (select layer) on an event driven basis. The infra-structure itself should\nbe non-blocking and asynchronous for performance and scalability.\n\nThe API layer should be provided by a simple WSGI application implemented using\nthe [Appier Framework](https://github.com/hivesolutions/appier) to keep things\nsimple and fast.\n\nFor persistence the pushi infra-structure uses the MongoDB database infra-structure\nto avoid any unwanted complexities and provide fast performance.\n\n## Inspiration\n\nPushi was heavily inspired by the [Pusher](http://pusher.com) service, and aims\nat providing a free alternative to it (for cost reducing).\n\n## Channels\n\nThe channel is the base object for communication and there are four types of channels\nso that each one has its own objectives.\n\n### Public Channels\n\nChannels that may be subscribed by any connection without any sort of validation.\n\n### Private Channels\n\nAuthenticated channels for which the access is constrained to only server side\nvalidated connections. The validation is performed using a REST-JSON based API.\n\n### Presence Channels\n\nChannels that provide extra information on the situation on the channel, for instance\nallow the identification of a set of connection using a single `user_id` tag. Using\nthis approach it's possible to know when a new user connects to a channel and when\none disconnects (no more connections with the same `user_id` are present). These channels\nare considered private and so are subject to validation from the server side.\n\n### Personal Channels\n\nThis channels provide the capability to aggregate a series of (personal) subscriptions\ninto a single channel (for simplicity). This way it's easy to aggregate a stream of\nnotifications that arise from a group of channels. This channel must be used together\nwith the publish subscribe model. A channel of this type should be named `personal-\u003cuser_id\u003e`.\n\n### Peer Channels\n\nTargeted at chat environment allows for the creation of automatic channels for the\nvarious elements (users) that are subscribed to a peer channel. The activation of the\nautomatic peer channel configuration is archived using the `peer` flag in the `channel_data`\nstructure upon the subscription of such channel. This channel type **should not be created directly\nbut instead should be created through presence channels**.\n\nThe management of these kind of channels implies that the `peer` advertisement flag is set\nfor a channel shared among the peers, from that moment the peer is visible to all the\nother peers upon subscription of that shared channel. These kind of channels should\nbe used together with the presence channels.\n\nThe naming of these kind of channels will always follow the structure\n`peer-base_channel:user_1\u0026user_2\u0026user_3`.\n\n## Persistence\n\nIt's possible to use pushi to store messages in the server side in a publish/subscriber\nway so that a `user_id` may subscribe for a certain channel even when it's offline.\n\n### Subscribe\n\nTo be able to subscribe for a channel use the `apps/\u003capp_id\u003e/subscribe` route with the\n`user_id` and the `event` parameters indicating both the id and the name of the event\nthat should be subscribed.\n\n### Unsubscribe\n\nTo revert the subscribe operation one should call the `apps/\u003capp_id\u003e/unsubscribe` route\nwith the same `user_id` and the `event` parameters.\n\n### Usage\n\nWhen a user connects to the channel that it has subscribed the last messages are returned\nas part of the `channel_data` structure.\n\n## Running\n\nTo be able to run the pushi infra-structure under a normal non encrypted connection\nand bind to the complete set of network interfaces in the host the following command:\n\n    APP_HOST=0.0.0.0 \\\n    APP_PORT=8080 \\\n    SERVER_HOST=0.0.0.0 \\\n    SERVER_PORT=80 \\\n    python pushi/src/pushi/base/state.py \u003c /dev/null \u0026\u003e ~/pushi.log \u0026\n\nTo be able to run in using SSL encryption additional commands must be used, please note\nthat the SSL port used by the app is not the default one:\n\n    APP_SERVER=netius \\\n    APP_HOST=0.0.0.0 \\\n    APP_PORT=9090 \\\n    APP_SSL=1 \\\n    APP_SSL_KEY=/path/to/file.key \\\n    APP_SSL_CER=/path/to/file.cer \\\n    SERVER_HOST=0.0.0.0 \\\n    SERVER_PORT=443 \\\n    SERVER_SSL=1 \\\n    SERVER_SSL_KEY=/path/to/file.key \\\n    SERVER_SSL_CER=/path/to/file.cer \\\n    python pushi/src/pushi/base/state.py \u003c /dev/null \u0026\u003e ~/pushi.log \u0026\n\n## Quick Start\n\n### Client Side\n\n```javascript\nvar pushi = new Pushi(\"YOU_APP_KEY\");\npushi.bind(\"message\", function(event, data) {\n    jQuery(\"body\").append(\"\u003cdiv\u003e\" + data + \"\u003c/div\u003e\");\n});\n```\n\n### Server Side\n\n```python\nimport pushi\n\nproxy = pushi.Pushi(\n    app_id = \"YOU_APP_ID\",\n    app_key = \"YOU_APP_KEY\",\n    app_secret = \"YOU_APP_SECRET\"\n)\nproxy.trigger_event(\n    channel = \"global\",\n    data = \"hello world\",\n    event = \"message\"\n)\n```\n\n## License\n\nPushi System is currently licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/).\n\n## Build Automation\n\n[![Build Status](https://github.com/hivesolutions/pushi/workflows/Main%20Workflow/badge.svg)](https://github.com/hivesolutions/pushi/actions)\n[![Coverage Status](https://coveralls.io/repos/hivesolutions/pushi/badge.svg?branch=master)](https://coveralls.io/r/hivesolutions/pushi?branch=master)\n[![PyPi Status](https://img.shields.io/pypi/v/pushi.svg)](https://pypi.python.org/pypi/pushi)\n[![PyPi Status](https://img.shields.io/pypi/v/pushi-service.svg)](https://pypi.python.org/pypi/pushi-service)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhivesolutions%2Fpushi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhivesolutions%2Fpushi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhivesolutions%2Fpushi/lists"}