{"id":16842547,"url":"https://github.com/rofl0r/pyhttpd","last_synced_at":"2025-07-20T16:36:24.710Z","repository":{"id":138311786,"uuid":"395517746","full_name":"rofl0r/pyhttpd","owner":"rofl0r","description":"simple, tiny, multithreaded single-file http server without dependencies other than python2","archived":false,"fork":false,"pushed_at":"2025-02-18T18:29:44.000Z","size":182,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T21:54:29.335Z","etag":null,"topics":["file-sharing","http-server","httpd","macros","multi-threading","no-dependencies","python","simple","simple-http-server","single-file","stand-alone","tiny","web-application-server"],"latest_commit_sha":null,"homepage":"","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/rofl0r.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-08-13T04:12:36.000Z","updated_at":"2025-02-18T18:29:48.000Z","dependencies_parsed_at":"2024-04-28T22:30:13.231Z","dependency_job_id":"249f1946-c0cd-4be2-877f-4967c22a2284","html_url":"https://github.com/rofl0r/pyhttpd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fpyhttpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fpyhttpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fpyhttpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fpyhttpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rofl0r","download_url":"https://codeload.github.com/rofl0r/pyhttpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122861,"owners_count":20564397,"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":["file-sharing","http-server","httpd","macros","multi-threading","no-dependencies","python","simple","simple-http-server","single-file","stand-alone","tiny","web-application-server"],"created_at":"2024-10-13T12:46:36.053Z","updated_at":"2025-03-23T15:31:36.716Z","avatar_url":"https://github.com/rofl0r.png","language":"Python","readme":"pyhttd\n======\n\na tiny, multithreaded http server in pure python2 without external\ndependencies.\n\nabout\n-----\n\nit's basically a replacement for `python -m SimpleHTTPServer` allowing\none to quickly serve contents of the current directory for file transfers\nacross machines, however unlike SimpleHTTPServer allows to continue file\ndownloads where you left off using HTTP/1.1 Ranges.\n\njust drop the pyhttp.py somewhere in your `$PATH`, cd to the directory\nyou want to serve and run `pyhttpd.py` and launch your browser on the other\nend.\n\nalso unlike SimpleHTTPServer/BaseHTTPServer which were written in a horrible\nOOP-style requiring mind-bending class inheritance by some java fanboi,\npyhttpd uses a simple and tiny procedural codebase, which can be easily\nextended/modified and serve as an application server and as a replacement for\nflask (which requires lots of dependencies) and other similar projects.\n\nthere's an optional script called `pyexpander.py` included in the directory\nwhich is not required for basic functionality, but when made available\nto pyhttpd, turns .html files into server pages with full python and macro\nscripting facilities. see [pyexpander.rst](pyexpander.rst) for docs and\nto learn what you can do with it.\npyexpander has been modified by me to use `~` instead of `$` for its\nexpansion facilities in order to work smoothly with embedded javascript,\nand \"amalgamated\" into a single file.\nusage of pyexpander requires the command line option `-x`.\n\nusage\n-----\njust run `python2 pyhttpd.py` to serve contents of current directory\non `0.0.0.0` interface and port `8000`. if you pass a command line\nargument, it's treated as a port number to use instead.\n\n**NEW!!!!1**\npyhttpd now has an extended mode, which allows to override port, ip,\nroot directory, and even the main client loop of the app.\nhelp output:\n\n```\npyhttpd (c) 2021 rofl0r.\nsimple mode (zero or one argument):\npyhttpd [PORT]\n        serves current directory on 0.0.0.0 port 8000, or on PORT\n\nextended mode:\npyhttpd [OPTIONS]\n        available OPTIONS:\n        -i LISTENIP - specify ip to listen on\n        -p PORT     - specify port to listen on\n        -r ROOT     - specify root directory of webservice\n        -a APP      - specify python module name for client_main()\n        -A FILE     - read basic auth user:pass from FILE (use - for stdin)\n        -x          - enable pyexpander macro language\n```\n\nsee `helloworld.py` for how a custom app may look like, and run\n\n    pyhttpd -a helloworld\n\nthis allows you to run your own web app without having to mess\nwith the code inside `pyhttpd.py`.\n\nbasic auth\n----------\nin order to use basic authentication to access the \"built-in app\",\nwhich serves files and directory listings (if no index.html is found),\nuse argument `-A FILE` with a filename containing a user:pass pair\nseparated with a colon character. `-A -` reads the pair from stdin.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frofl0r%2Fpyhttpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frofl0r%2Fpyhttpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frofl0r%2Fpyhttpd/lists"}