{"id":17361196,"url":"https://github.com/niqzart/flask-socketio-example","last_synced_at":"2026-05-04T03:35:31.836Z","repository":{"id":115916264,"uuid":"418448522","full_name":"niqzart/flask-socketio-example","owner":"niqzart","description":"Short example of a minimal flask-socketio application, that actually works. No compatibility errors, no too old libraries. Config for heroku is in the repo as well.","archived":false,"fork":false,"pushed_at":"2021-12-21T18:41:11.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T16:51:54.367Z","etag":null,"topics":["flask","flask-application","flask-socketio","heroku","socket-io"],"latest_commit_sha":null,"homepage":"https://flask-socketio-example.herokuapp.com/","language":"HTML","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/niqzart.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-10-18T10:19:36.000Z","updated_at":"2021-12-21T18:41:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"d98301f5-d2c4-44fc-8dae-0cf63764a8d2","html_url":"https://github.com/niqzart/flask-socketio-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/niqzart/flask-socketio-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqzart%2Fflask-socketio-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqzart%2Fflask-socketio-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqzart%2Fflask-socketio-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqzart%2Fflask-socketio-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niqzart","download_url":"https://codeload.github.com/niqzart/flask-socketio-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqzart%2Fflask-socketio-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32593945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["flask","flask-application","flask-socketio","heroku","socket-io"],"created_at":"2024-10-15T19:31:48.562Z","updated_at":"2026-05-04T03:35:31.811Z","avatar_url":"https://github.com/niqzart.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask SocketIO Example\n\n### Why?\nI haven't found a good described example for that. Ones I found are either too old and use old versions of used libraries (which is not ideal) or don't work because of a version compatibility issue(s). I managed to make it work, but it did take a few hours. \n\n*I hope this example will help someone to not waste the same amount of time.*\n\n### What does it do?\nIt's a python web server that serves an HTML page with a chat-like interface. You can send messages, which are processed by flask-soketio and broadcasted to everyone connected to the main page.\n\nThe example is hosted on heroku, you can visit it and try it out for yourself [here](https://flask-socketio-example.herokuapp.com/). Open up two tabs with it and chat!\n\n### A bit on how I will try to make this example future-proof\n1. All requirements are marked as exact versions, so version compatibility shouldn't become a problem\n2. I'm still working on an app with flask-socketio, this repo will be updated from time to time (last update date == last commit date)\n3. If some links go dead, I'll replace them, you can report such links in issues\n\n### What should be redone for production environment?\nCORS policy. Currently it's allowing any origins, that should never be a thing in a production environment. See `flask-socketio` documentation for info on [CORS configuration](https://flask-socketio.readthedocs.io/en/latest/deployment.html#cross-origin-controls)\n\n### Hot to run it locally?\n1. Clone the repo\n2. Create a virtual python environment (https://docs.python.org/3/library/venv.html)\n3. Open a console \u0026 activate the virtual environment\n4. Install requirements: `pip install -r requirements.txt`\n5. Run the main file: `python main.py`\n6. Done! Web server should be running at `http://localhost:5000/`\n\n### How to deploy this to heroku?\n1. Clone the repo\n2. Open a console in repo's folder\n3. Create an application on heroku\n4. Login to heroku CLI: `heroku login`\n5. Attach your heroku app as a git remote: `heroku git:remote -a your-app-name-here`\n6. Push it to heroku: `git push heroku master`\n7. Wait for it to deploy, when visit your applications page, and you're done!\n\n### Links\n\n- Why an older version of eventlet is used:\n    - https://stackoverflow.com/questions/67409452/gunicorn-importerror-cannot-import-name-already-handled-from-eventlet-wsgi\n\n- Deployment of flask-socketio applications:\n    - https://flask-socketio.readthedocs.io/en/latest/deployment.html\n\n- Client configuration:\n    - https://socket.io/docs/v4/client-installation/#standalone-build\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqzart%2Fflask-socketio-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniqzart%2Fflask-socketio-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqzart%2Fflask-socketio-example/lists"}