{"id":26433764,"url":"https://github.com/charlysan/gidm","last_synced_at":"2026-05-20T06:07:29.520Z","repository":{"id":49986680,"uuid":"370855475","full_name":"charlysan/gidm","owner":"charlysan","description":"Simple http proxy man in the middle tool","archived":false,"fork":false,"pushed_at":"2022-01-18T13:24:47.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T22:34:40.608Z","etag":null,"topics":["api","cli","debug","docker","go","golang","http","man-in-the-middle","midm","proxy","rest"],"latest_commit_sha":null,"homepage":"","language":"Go","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/charlysan.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}},"created_at":"2021-05-25T23:46:11.000Z","updated_at":"2024-06-20T22:34:40.609Z","dependencies_parsed_at":"2022-09-19T01:10:08.271Z","dependency_job_id":null,"html_url":"https://github.com/charlysan/gidm","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fgidm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fgidm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fgidm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fgidm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlysan","download_url":"https://codeload.github.com/charlysan/gidm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173576,"owners_count":20410301,"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":["api","cli","debug","docker","go","golang","http","man-in-the-middle","midm","proxy","rest"],"created_at":"2025-03-18T07:18:41.421Z","updated_at":"2026-05-20T06:07:29.475Z","avatar_url":"https://github.com/charlysan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gidm\nSimple http proxy man-in-the-middle tool\n\n## Intro\n\n`gidm` is a minimalist http proxy that can be used as \"man-in-the-middle\" tool capable of manipulating requests and responses.\n\n## Installation\n\n### Build from source\n\n[GO v1.15](https://golang.org/doc/go1.15) or greater is required. Just clone this repo and build as usual:\n\n```\ngo build\n```\n\nOr build \u0026 install:\n\n```\ngo install\n```\n\n### Download release binaries\n\nYou can also download Linux and MacOS pre-built binaries from [releases section](https://github.com/charlysan/gidm/releases).\n\n### Docker Image\n\nDocker image is also available from [DockerHub](https://hub.docker.com/r/charlysan/gidm). You will find some use cases in section [Examples](#run-using-docker).\n\n\n## Usage\n\nYou can run the tool along with `--help` option to get a list of supported commands:\n\n```bash\n$ ./gidm --help\nNAME:\n   gidm - Simple midm tool\n\nUSAGE:\n   gidm [global options] command [command options] [arguments...]\n\nVERSION:\n   v0.2.1\n\nCOMMANDS:\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --reqh value   inject request header\n   --resh value   inject response header\n   --reqb value   replace string in request body (/old/new/)\n   --resb value   replace string in response body (/old/new/)\n   -p value       listen to port (default: \"8080\")\n   -u value       redirect to url (default: \"http://localhost:9000\")\n   -i value       enable interactive mode (API server will listen on specified port)\n   -d             enable debugging (default: false)\n   --help, -h     show help (default: false)\n   --version, -v  print version (default: false)\n```\n\n## Examples\n\n### Inject Request Headers\n\nListen on port `8081` and forward to `http://localhost:9000`, show debug information and inject the following headers:\n- `x-custom-flag: true`\n- `x-custom-id: 12345`\n\n\n```bash\ngidm \\\n-p 8081 \\\n-u http://localhost:9000 \\\n-reqh \"x-custom-flag: true\" \\\n-reqh \"x-custom-id: 12345\" \\\n-d\n```\n\nPOST something to `localhost:8081`:\n```bash\ncurl -X POST \\\nhttp://localhost:8081/dummy \\\n-H \"content-type: application/json\" \\\n-d '{\"name\": \"john doe\"}'\n```\n\nYou should get this output:\n```bash\nListening on port: 8081\nRedirecting to: http://localhost:9000\n\nRequest headers to be injected:\n  x-custom-flag: true\n  x-custom-id: 12345\n\n2021/05/31 18:34:16 POST /dummy HTTP/1.1\nHost: localhost:9000\nAccept: */*\nContent-Length: 20\nContent-Type: application/json\nUser-Agent: curl/7.64.1\nX-Custom-Flag: true\nX-Custom-Id: 12345\n\n{\"name\": \"john doe\"}\n\n2021/05/31 18:34:16 HTTP/1.1 404 Not Found\nContent-Length: 22\nContent-Type: application/json\nDate: Mon, 31 May 2021 21:34:16 GMT\nServer: uvicorn\n\n{\"detail\":\"Not Found\"}\n```\n\n### Replace body strings\n\nYou can add string replacers for request and response body. \nFor example, to replace every `ok` with `BAD` in your response body, you can use this command:\n\n```bash\n./gidm \\\n-p 8081 \\\n-u http://localhost:9000 \\\n-reqh \"x-custom-flag: true\" \\\n-reqh \"x-custom-id: 12345\" \\\n-resb \"/ok/BAD/\" \\\n-d\n```\n\n### Run using Docker\n\nGrab Docker image from [DockerHub](https://hub.docker.com/r/charlysan/gidm):\n\n```bash\ndocker pull charlysan/gidm\n```\n\nRun and add the proper port-forwarding:\n\n```bash\ndocker run \\\n-p 8081:8080 \\\n-p 9090:9090 \\\ncharlysan/gidm \\\n-u https://api.chucknorris.io \\\n-resb \"/Chuck Norris/John Doe/\" \\\n-i 9090 \\\n-d\n```\n\n```bash\n$ curl http://localhost:8081/jokes/random | json_pp\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100   342  100   342    0     0    421      0 --:--:-- --:--:-- --:--:--   421\n{\n   \"value\" : \"Most people have Microwave ovens. John Doe has a Megawave oven.\",\n   \"url\" : \"https://api.chucknorris.io/jokes/t-ipnAxeTFCpF6cLvN9_-Q\",\n   \"id\" : \"t-ipnAxeTFCpF6cLvN9_-Q\",\n   \"created_at\" : \"2020-01-05 13:42:23.880601\",\n   \"icon_url\" : \"https://assets.chucknorris.host/img/avatar/chuck-norris.png\",\n   \"categories\" : [],\n   \"updated_at\" : \"2020-01-05 13:42:23.880601\"\n}\n```\n\n## Interactive Mode\n\nInteractive Mode allows to modify the proxy behavior without restarting the app. Te proxy will listen on the port specified using `-i \u003cPORT\u003e` flag:\n\n```bash\n./gidm \\\n-p 8081 \\\n-u http://localhost:9000 \\\n-reqh \"x-custom-flag: true\" \\\n-reqh \"x-custom-id: 12345\" \\\n-resb \"/ok/BAD/\" \\\n-i 9090 \\\n-d\n```\n\nAnd it will expose the following endpoints:\n\n```\nPUT /requestHeaders\nPUT /responseHeaders\nPUT /requestBodyReplacers\nPUT /responseBodyReplacers\n```\n\nSo, supposing you want to change the response body string replacers you can hit the proxy with this payload:\n\n```\ncurl -X PUT \\\nhttp://localhost:9090/responseBodyReplacers \\\n-d '{\"ok\": \"WRONG!!\"}'\n```\n\nAnd the proxy should show the following log:\n```\nResponse Body string replacers updated\n  ok -\u003e WRONG!!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlysan%2Fgidm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlysan%2Fgidm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlysan%2Fgidm/lists"}