{"id":20549499,"url":"https://github.com/akullpp/groxy","last_synced_at":"2025-04-14T11:05:24.906Z","repository":{"id":57639948,"uuid":"311326345","full_name":"akullpp/groxy","owner":"akullpp","description":"Simple reverse proxy to proxy requests based on the first path segment to the correct service in order to substitute services partially in local development","archived":false,"fork":false,"pushed_at":"2021-12-13T22:17:38.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T11:05:20.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/akullpp.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}},"created_at":"2020-11-09T12:08:19.000Z","updated_at":"2023-09-16T21:23:58.000Z","dependencies_parsed_at":"2022-09-07T16:13:56.175Z","dependency_job_id":null,"html_url":"https://github.com/akullpp/groxy","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/akullpp%2Fgroxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Fgroxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Fgroxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Fgroxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akullpp","download_url":"https://codeload.github.com/akullpp/groxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868768,"owners_count":21174757,"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":[],"created_at":"2024-11-16T02:18:14.141Z","updated_at":"2025-04-14T11:05:24.886Z","avatar_url":"https://github.com/akullpp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reverse Proxy\n\nSimple reverse proxy to proxy requests based on the first path segment to the correct service in order to substitute services partially in local development.\n\n## Installation\n\n```\ngit clone https://github.com/akullpp/groxy.git\n```\n\n## Configuration\n\nCreate a `.env.local` of the following form:\n\n```\nFOO=http://localhost:1000\nBAR=http://localhost:2000\n```\n\n* Requests which paths start with `FOO` (e.g. `foo/baz`) will be forwarded to `http://localhost:1000` (e.g `http://localhost:1000/foo/baz`).\n\n* Requests which paths start with `BAR` (e.g. `bar/baz`) will be forwarded to `http://localhost:2000` (e.g `http://localhost:2000/bar/baz`).\n\n* Requests which first path segment do not match will be forwarded to the DEFAULT value in `.env` (e.g. `http://localhost:8080`).\n\nYou also have the ability to drop the path prefix, by adding `\u003cPREFIX\u003e_DROP_PREFIX=true`, e.g.\n\n```\nFOO=http://localhost:1000\nBAR=http://localhost:2000\nBAR_DROP_PREFIX=true\n```\n\nThis will forward requests of `localhost:9999/bar/baz` to `localhost:2000/baz`.\n\n### Usage\n\n```\ngo run ./main.go\n```\n\nI suggest to use [reflex](https://github.com/cespare/reflex) in order to restart the server if the `.env.local` changes:\n\n```\nreflex -r '\\.env\\.local' -s -- sh -c 'go run ./main.go'\n```\n\n## Example\n\nIf you want to route requests that start with `user` to `http://localhost:8100`:\n\n```\nUSER=http://localhost:8100\n```\n\n## Dependencies\n\nI extracted the reading of the reading of environment files to another package (see [gotenv](https://github.com/akullpp/gotenv)) which only uses the standard library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakullpp%2Fgroxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakullpp%2Fgroxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakullpp%2Fgroxy/lists"}