{"id":22682222,"url":"https://github.com/hyper-prog/hasses","last_synced_at":"2025-04-12T17:25:03.775Z","repository":{"id":45053657,"uuid":"163820642","full_name":"hyper-prog/hasses","owner":"hyper-prog","description":"Hyper's Asynchronous Server Sent event (SSE) notification Server","archived":false,"fork":false,"pushed_at":"2024-04-22T11:56:29.000Z","size":299,"stargazers_count":23,"open_issues_count":3,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-22T13:04:01.573Z","etag":null,"topics":["browser-notification","daemon","epoll","notification-server","sse","sse-connections","webserver"],"latest_commit_sha":null,"homepage":"http://hyperprog.com/hasses/index.html","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyper-prog.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-01-02T09:27:38.000Z","updated_at":"2024-04-23T14:27:57.533Z","dependencies_parsed_at":"2024-04-23T14:27:56.648Z","dependency_job_id":"c258ca00-01c5-4ba4-b3e7-500bc5201052","html_url":"https://github.com/hyper-prog/hasses","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper-prog%2Fhasses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper-prog%2Fhasses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper-prog%2Fhasses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper-prog%2Fhasses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyper-prog","download_url":"https://codeload.github.com/hyper-prog/hasses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248603241,"owners_count":21131766,"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":["browser-notification","daemon","epoll","notification-server","sse","sse-connections","webserver"],"created_at":"2024-12-09T20:25:57.217Z","updated_at":"2025-04-12T17:25:03.754Z","avatar_url":"https://github.com/hyper-prog.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Hasses logo](https://raw.githubusercontent.com/hyper-prog/hasses/master/images/hasseslogo.png)\n\nHyper's async SSE (Server Sent Event) server\n============================================\n\nHasses is a small notification server achieve Server Sent Event (SSE) listener\nin a separate daemon.\nIt's written in C and it has asynchronous design to handle more clients in same thread.\nIt uses linux epoll() function.\n\n - What is SSE: http://en.wikipedia.org/wiki/Server-sent_events\n - What is epoll (Asyncronous programming): http://en.wikipedia.org/wiki/Epoll\n\nMost SSE example uses server side codes holds a connection to each client.\nIt is usually means a process/thread for each client connection,\nwhich is not optimal when the number of clients are rising.\nThis daemon act as a minimal web server which suitable to handle SSE connections only,\nand can handle all incoming connections in one thread.\nThe main web server environment (which serve the web pages) can send the notifications\nto the clients through a separate network connection or a FIFO file.\nThe clients can connect to the hasses server with a special token(s),\nwhich are usable to address messages to a subset of clients or even one client.\nThe daemon has a rich logging and client tracking possibility.\n\nAuthor\n------\n\n- Written by Peter Deak (C) hyper80@gmail.com, License GPLv2\n- Webpage: http://hyperprog.com/hasses\n\nCompile / Install\n-----------------\nRequire openssl development tools\n(debian: aptitude install libssl-dev)\n\n    $make\n    #make install\n\nDocker images\n-------------\nAvailable an Alpine linux container with the configured hasses daemon:\n Docker hub:\n\n- https://hub.docker.com/r/hyperprog/hassesdaemon\n\n Downloadable (pullable) image name:\n \n    hyperprog/hassesdaemon\n\nThe image expose the 8080 port to SSE connections \nand the 8085 for control channel communication messages.\nThe sse requests matches to the /sse locations by default.\n\n Architecture\n ------------\n \n ![Hasses Arch](https://raw.githubusercontent.com/hyper-prog/hasses/master/images/architecture.png)\n\n#### Config for apache2 proxy\n\n    #aptitude install libapache2-mod-proxy-html\n    #aptitude install libxml2-dev xml2 libxml2\n\n    #a2enmod ssl\n    #a2enmod proxy\n    #a2enmod proxy_balancer\n    #a2enmod proxy_http\n\n    To the enabled site:\n\n    ProxyPreserveHost On\n\t  ProxyPass /sseeventprovider http://0.0.0.0:8080/sseeventprovider\n\t  ProxyPassReverse /sseeventprovider http://0.0.0.0:8080/sseeventprovider\n\n\n#### Config for nginx proxy\n\nTo the enabled site outside the \"server\" section:\n\n    upstream ssebackend {\n        server 127.0.0.1:8080;\n        keepalive 3200;\n    }\n\nTo the enabled site inside the \"server\" section:\n\n    location /sseeventprovider {\n        proxy_buffering off;\n        proxy_cache off;\n        keepalive_timeout 0;\n        proxy_set_header Connection \"Keep-Alive\";\n        proxy_http_version 1.1;\n        chunked_transfer_encoding on;\n        proxy_pass http://ssebackend;\n    }\n\n\n Debugging / Troubleshooting\n ---------------------------\n\nIf you would like get informations about the hasses internal state, get statistics or client information you can send commands\nto the hasses communication channel to modify the internal state, or get information to the log output.\nIt also possible the receive information on communication channels. (with \"tcp\" prefixed commands, these command are replied in json format)\n\nThese commands are:\n\n    \"status\" - Print status/statistics to the log\n    \"tcpstatus\" - Send status/statistics back to the sender on communication channel\n    \"clientlist\" - List clients to the log\n    \"loglevel_quiet\" - Set loglevel to minimal\n    \"loglevel_normal\" - Set loglevel to normal\n    \"loglevel_debug\" - Set loglevel to maximum\n    \"numberofclients\" - Print number of clients to the log\n    \"tcpnumberofclients\" - Send number of clients back to the sender on communication channel\n    \"reinit_enable\" - Enable re-initialize opened connections\n    \"reinit_disable\" - Enable re-initialize opened connections\n    \"subscribedclients:\u003csub\u003e\" - Print number of the subscribed clients to the log\n    \"tcpsubscribedclients:\u003csub\u003e\" - Send number of the subscribed clients back to the sender\n    \"\u003ctoken\u003e=\u003cmessage\u003e\" - Send message to the subscribers of \u003ctoken\u003e\n    \"\u003ctoken\u003e=\u003cmessage\u003e;\u003ctoken2\u003e=\u003cmessage2\u003e\" - Send more messages\n    \"\u003ctoken\u003e-\u003crId\u003e=\u003cmessage\u003e\" - Send message to the subscribers of \u003ctoken\u003e except \u003crId\u003e\n    \"*=\u003cmessage\u003e;\" - Send message to all clients\n\nTo send the \"status\" command to the /var/run/myprog/hassesfifo file:\n\n    echo \"status\" | /var/run/myprog/hassesfifo\n\nTo send the \"status\" command to the 8085 tcp port communication channel (on 192.168.1.10 ip)\n\n    echo \"status\" | netcat 192.168.1.10 8085\n\nThe \"status\" command will generate similar message to the log:\n\n    ------- status of hasses -------\n    Version: 1.22\n    Compiled: May  7 2020\n    Pid: 3217\n    Uid: 0 (not set)\n    Running time: 00:00:26\n    Mode: unencrypted (http)\n    Loglevel: 2\n    Reinit allowed: no\n    CORS-base url: *\n    Count of connected clients: 0\n    Current registred SSE clients: 0\n    Maximum number of connections: 0\n    Total client handshaked: 0\n    Total reinit connection: 0\n    Total message processed: 0\n    Total message sent: 0\n    ------------- end --------------\n\nThe \"clientlist\" command will generate output like this:\n\n    ------- requested client list -------\n    List of clients:\n    #1 - \u003c6\u003e info: 192.168.1.151:50190 S:SSE Err: 0 Messages: 3 Reinit: 0 SSL:No\n      Connection time: 00:03:00  Handshaked time: 00:03:00 UniqId:\n      Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0\n      Subscribes: room624\n    #2 - \u003c7\u003e info: 192.168.1.151:50200 S:SSE Err: 0 Messages: 0 Reinit: 0 SSL:No\n      Connection time: 00:00:09  Handshaked time: 00:00:09 UniqId:\n      Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\n      Subscribes: room686\n    ---------------- end ----------------\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper-prog%2Fhasses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyper-prog%2Fhasses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper-prog%2Fhasses/lists"}