{"id":19383375,"url":"https://github.com/mdouchement/switchman","last_synced_at":"2025-04-23T21:31:54.220Z","repository":{"id":79844621,"uuid":"106297052","full_name":"mdouchement/switchman","owner":"mdouchement","description":"A simple proxy pass for developers","archived":true,"fork":false,"pushed_at":"2017-10-09T14:54:07.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T17:17:13.121Z","etag":null,"topics":["development","golang","proxy-server"],"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/mdouchement.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":"2017-10-09T14:52:09.000Z","updated_at":"2024-03-11T10:06:16.000Z","dependencies_parsed_at":"2023-09-15T14:46:42.510Z","dependency_job_id":null,"html_url":"https://github.com/mdouchement/switchman","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/mdouchement%2Fswitchman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fswitchman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fswitchman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fswitchman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdouchement","download_url":"https://codeload.github.com/mdouchement/switchman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250517832,"owners_count":21443852,"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":["development","golang","proxy-server"],"created_at":"2024-11-10T09:25:54.473Z","updated_at":"2025-04-23T21:31:54.213Z","avatar_url":"https://github.com/mdouchement.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Switchman - A simple proxy pass for developers\n\nSwitchman is currently an easy to use proxy pass for development environments.\nIt forwards requests from the `listen` interface to the destination server and allow to `rewrite` the routes.\n\n## Installation\n\n```sh\ngo get -u github.com/mdouchement/switchman\n```\n\n\n## Requirements\n\n- Golang 1.7 and above\n\n\n## Usage\n\n```sh\nswitchman -c my_switchman.yml\n```\n\n\n## Configuration file\n\n```yaml\nlisten: localhost:4242\nrules:\n  \"/files/*\":\n    name: Minio\n    type: proxy\n    url: http://localhost:9000\n  \"/api/*\":\n    name: MyAPI\n    type: proxy\n    url: http://localhost:3000\n    rewrite:\n      from: \"/api(?P\u003ckeep\u003e.*)\"\n      to: \"\u003ckeep\u003e\"\n  \"/*\":\n    name: MyFrontendAssets\n    type: proxy\n    url: http://localhost:8000\n```\n\nThe key of a rule is the matching pattern of all requests path.\n\nThe rewrite `from` field use the Golang Regexp named groups functionality that you can combine as you want in the `to` field.\nYou can write more complicated example as:\n\n```yaml\nrewrite:\n  from: \"/api(?P\u003ckeep\u003e[^\\?]*)\\?(?P\u003cqueries\u003e.*)\"\n  to: \"\u003ckeep\u003e/new?\u003cqueries\u003e\"\n\n#  in: /api/datasets?toto=trololo\n# out: /datasets/new?toto=trololo\n```\n\n\n## License\n\n**MIT**\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n5. Push to the branch (git push origin my-new-feature)\n6. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdouchement%2Fswitchman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdouchement%2Fswitchman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdouchement%2Fswitchman/lists"}