{"id":16760632,"url":"https://github.com/tabuna/stone","last_synced_at":"2025-03-16T09:22:53.250Z","repository":{"id":57064425,"uuid":"153518017","full_name":"tabuna/stone","owner":"tabuna","description":"Laravel Stone - HTTP server using the ReactPHP.","archived":false,"fork":false,"pushed_at":"2023-05-13T03:03:00.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T21:30:21.720Z","etag":null,"topics":["laravel","php","reactphp","reactphp-server","server"],"latest_commit_sha":null,"homepage":"","language":null,"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/tabuna.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":"2018-10-17T20:16:03.000Z","updated_at":"2023-05-13T02:57:42.000Z","dependencies_parsed_at":"2024-11-19T01:43:47.059Z","dependency_job_id":null,"html_url":"https://github.com/tabuna/stone","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"d134fff4b53d5824d04e36cf98ab1ae9b4d96f3e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuna%2Fstone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuna%2Fstone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuna%2Fstone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuna%2Fstone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabuna","download_url":"https://codeload.github.com/tabuna/stone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243848319,"owners_count":20357534,"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":["laravel","php","reactphp","reactphp-server","server"],"created_at":"2024-10-13T04:24:07.100Z","updated_at":"2025-03-16T09:22:53.215Z","avatar_url":"https://github.com/tabuna.png","language":null,"readme":"\n\n# Laravel Stone - HTTP server using the  \u003ca href=\"https://reactphp.org\" target=\"_blank\"\u003eReactPHP\u003c/a\u003e\n\n\n\nWith ReactPHP we keep our application alive between requests so we only execute this bootstrap once when starting the server: the footprint is absent from Requests.\nHowever now the tables are turned: we're vulnerable to memory consumption, fatal error, statefulness and code update worries.\n\n## Installation\n\nInstaller using Composer:\n\n```bash\n$ composer require tabuna/stone\n```\n\n## Example\n\n\nThe easiest way to run:\n\n```bash\n$ php vendor/bin/stone\n```\n\nYou can also specify a port:\n\n```bash\n$ php vendor/bin/stone -p 8000\n```\n\nIt does not interfere with your application, so do not worry\n\n## Making production ready\n\n### Supervisord\n\nInstall \u003ca href=\"http://supervisord.org/\" target=\"_blank\"\u003eSupervisord\u003c/a\u003e\n\n```bash\n$ sudo apt-get install -y supervisor\n```\n\nHere's a configuration example (create a `*.conf` file in `/etc/supervisord/conf.d`):\n\n\n```bash\n[program:laravel-stone-server]\ncommand=php /path/to/your/code/vendor/bin/stone -p 800%(process_num)\nprocess_name=%(program_name)s-%(process_num)d\nnumprocs=4\numask=022\nuser=foobar\nstdout_logfile=/var/log/supervisord/%(program_name)s-%(process_num)d.log              ; stdout log path, NONE for none; default AUTO\nstderr_logfile=/var/log/supervisord/%(program_name)s-%(process_num)d-error.log        ; stderr log path, NONE for none; default AUTO\nautostart=true\nautorestart=true\nstartretries=3\n```\n\nIt will:\n\n- run 4 servers on ports 8000, 8001, 8002 and 8003\n- it restarts them automatically when they crash (will try a maximum of 3 times, then give up)\n\n### Nginx as Load-Balancer\n\nWhat we do here is to proxy only requests that don’t point to a local file.\n\n```bash\nupstream stone  {\n    server 127.0.0.1:8000;\n    server 127.0.0.1:8001;\n    server 127.0.0.1:8002;\n    server 127.0.0.1:8003;\n}\n\n\nserver {\n    listen 80;\n    server_name example.com;\n    root /example.com/public;\n\n    add_header X-Frame-Options \"SAMEORIGIN\";\n    add_header X-XSS-Protection \"1; mode=block\";\n    add_header X-Content-Type-Options \"nosniff\";\n\n    index index.html index.htm index.php;\n\n    charset utf-8;\n\n    location / {\n        try_files $uri $uri/ /index.php?$query_string;\n    }\n\n    location = /favicon.ico { access_log off; log_not_found off; }\n    location = /robots.txt  { access_log off; log_not_found off; }\n\n    error_page 404 /index.php;\n\n    location ~ \\.php$ {\n        proxy_pass http://stone;\n        break;\n    }\n\n    location ~ /\\.(?!well-known).* {\n        deny all;\n    }\n}\n```\n\n## Donate \u0026 Support\n\nIf you would like to support development by making a donation you can do so [here](https://www.paypal.me/tabuna/10usd). \u0026#x1F60A;\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","funding_links":["https://www.paypal.me/tabuna/10usd"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabuna%2Fstone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabuna%2Fstone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabuna%2Fstone/lists"}