{"id":19133368,"url":"https://github.com/vasnake/http_get_files","last_synced_at":"2025-11-13T09:01:46.967Z","repository":{"id":255153100,"uuid":"848690321","full_name":"vasnake/http_get_files","owner":"vasnake","description":"Very simple Go program, enumerate files in given directory and serve them via HTTP GET","archived":false,"fork":false,"pushed_at":"2024-08-28T12:45:19.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T17:46:32.689Z","etag":null,"topics":["files","get","go","http","server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vasnake.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":"2024-08-28T08:18:08.000Z","updated_at":"2024-08-28T12:45:22.000Z","dependencies_parsed_at":"2024-08-28T10:10:58.939Z","dependency_job_id":"a5dfc34b-9224-4960-9c5e-74afb824cc2a","html_url":"https://github.com/vasnake/http_get_files","commit_stats":null,"previous_names":["vasnake/http_get_files"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vasnake/http_get_files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasnake%2Fhttp_get_files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasnake%2Fhttp_get_files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasnake%2Fhttp_get_files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasnake%2Fhttp_get_files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasnake","download_url":"https://codeload.github.com/vasnake/http_get_files/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasnake%2Fhttp_get_files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284185868,"owners_count":26961592,"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","status":"online","status_checked_at":"2025-11-13T02:00:06.582Z","response_time":61,"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":["files","get","go","http","server"],"created_at":"2024-11-09T06:22:13.019Z","updated_at":"2025-11-13T09:01:46.940Z","avatar_url":"https://github.com/vasnake.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http_get_files\n\nVery simple Go program, enumerate files in given directory and serve them via HTTP GET\n\nMotivation: I tried to setup VLC streaming (server) on my win11 box,\njust to have an ability to watch a few TV series (files on my win11 box) on my phone.\nWell, this time VLC magic dindn't work for me.\nAfter a couple of hours I said to myself - \"fuck it, all I need is a primitive HTTP server, nothing more\".\nAnd there it is, a primitive HTTP server.\n\nOn my phone, in media player I just open HTTP stream from URL like `http://192.168.1.6:8080/1` and voilà,\nI'm watching first episode from selected season (directory) of my favorite TV show.\n\nBuilding and running in WSL2 under Win11 env:\n\nBuild\n```s\npushd /mnt/c/Users/vlk/data/github/http_get_files/\nPATH=${HOME}/go/bin:${PATH}\n\ngo mod init http_get_files\n\n# makes go vet happy\ncat \u003e main.go \u003c\u003c EOT\npackage main\nfunc main() { panic(\"not yet\") }\nEOT\n\ngo mod tidy\ngofmt -w .\ngo vet http_get_files\ngo test http_get_files\ngo run http_get_files\n\n# network setup, Win11 + WSL2\n\n# ubuntu\nifconfig # 172.19.24.89\n\n# win\nnetsh advfirewall firewall add rule name=\"Allowing LAN 8080\" dir=in action=allow protocol=TCP localport=8080\nnetsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8080 connectaddress=172.19.24.89 connectport=8080\nnetsh interface portproxy show v4tov4\nnetsh interface ip show address\n\n```\nsnippets\n\nProgram have two parameters: HTTP server port, and path to the directory with files to serve.\nUsage example: `go run http_get_files -port 8080 -path \"/mnt/c/Users/vlk/Downloads/TV_series\"`\n\nAll files in given directory will be sorted, enumerated starting from `1`,\nand made accessable via urls like `http://192.168.1.6:8080/1`\nwhere `192.168.1.6` is IP address for your box, and `8080` is IP port given in parameters.\n\nOutput example\n```s\n# wsl2\ngo run http_get_files -port 8080 -path /mnt/c/Users/vlk/Downloads/TV\n2024-08-28T11:16:46.724Z: Parameters: port, dir: \"8080\"; \"/mnt/c/Users/vlk/Downloads/TV\"; \n2024-08-28T11:16:46.726Z: skip directory \"Eng\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E01.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E02.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E03.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E04.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E05.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E06.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E07.avi\";\n2024-08-28T11:16:46.726Z: file added: \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E08.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"1\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E01.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"2\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E02.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"3\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E03.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"4\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E04.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"5\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E05.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"6\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E06.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"7\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E07.avi\";\n2024-08-28T11:16:46.726Z: added mapping \"8\"; \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E08.avi\";\n2024-08-28T11:16:46.726Z: Files mapping for server, Json:\n{\n  \"1\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E01.avi\",\n  \"2\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E02.avi\",\n  \"3\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E03.avi\",\n  \"4\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E04.avi\",\n  \"5\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E05.avi\",\n  \"6\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E06.avi\",\n  \"7\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E07.avi\",\n  \"8\": \"/mnt/c/Users/vlk/Downloads/TV/foobar-S1E08.avi\"\n}\n2024-08-28T11:16:46.726Z: Starting server at \":8080\";\n```\nsnippets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasnake%2Fhttp_get_files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasnake%2Fhttp_get_files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasnake%2Fhttp_get_files/lists"}