{"id":19460570,"url":"https://github.com/bjarneo/gecho","last_synced_at":"2025-04-25T07:33:22.077Z","repository":{"id":46546932,"uuid":"514914926","full_name":"bjarneo/gecho","owner":"bjarneo","description":"Gecho - a HTTP request echo debugging service","archived":false,"fork":false,"pushed_at":"2023-10-19T07:17:25.000Z","size":38,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T05:56:42.388Z","etag":null,"topics":["debugging","devops","echo","golang","http","http-server","request","sre"],"latest_commit_sha":null,"homepage":"","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/bjarneo.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":"2022-07-17T17:46:37.000Z","updated_at":"2024-01-02T00:39:56.000Z","dependencies_parsed_at":"2024-06-19T05:37:19.985Z","dependency_job_id":null,"html_url":"https://github.com/bjarneo/gecho","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/bjarneo%2Fgecho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjarneo%2Fgecho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjarneo%2Fgecho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjarneo%2Fgecho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjarneo","download_url":"https://codeload.github.com/bjarneo/gecho/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223990007,"owners_count":17237201,"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":["debugging","devops","echo","golang","http","http-server","request","sre"],"created_at":"2024-11-10T17:37:35.162Z","updated_at":"2024-11-10T17:37:35.589Z","avatar_url":"https://github.com/bjarneo.png","language":"Go","readme":"# gecho\n\nThis HTTP service will echo back the incoming request to you. Often while working on services that are hidden behind a proxy, or multiple proxies, a load balancer, an API gateway or however your infrastructure is built, you might want to know how the end request would look like. I.e. what headers has been removed, manipulated, or added.\n\n## Use cases\n\nWithout adding too much debugging to your application, you can use this service as a drop in replacement for the app you are debugging.\n\n* It has wildcard support for routes, so you can just change your application host with the host of this service\n* What is the end request headers after going through gateways/proxies/load balancers\n* Check the form data request body\n* Check JSON data request body\n* How about the file you are trying to upload?\n* Check the AUTH request headers\n\nSee some examples:\n\n## Examples by using HTTPIE\n\nPost JSON\n\n```bash\n# Post to whatever route you wish. I will be using echo.\nhttp localhost:1337/echo name=\"Something\" hobby=\"something else\"\n\nX-My-Header:gecho --auth username:password\nHTTP/1.1 200 OK\nContent-Encoding: gzip\nContent-Length: 250\nContent-Type: text/plain; charset=utf-8\nDate: Mon, 18 Jul 2022 07:59:33 GMT\nVary: Accept-Encoding\n\n=========================\n|--- REQUEST HEADERS ---|\n=========================\nConnection: keep-alive\nContent-Type: application/json\nX-My-Header: gecho\nContent-Length: 51\nUser-Agent: HTTPie/2.4.0\nAccept: application/json, */*;q=0.5\nAuthorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\n\n\n=========================\n|---- REQUEST  BODY ----|\n=========================\n{\"name\": \"Something\", \"hobby\": \"something else\"}\n```\n\nPost a FORM\n\n```bash\nhttp --form localhost:1337/echo file@\"test.txt\" X-My-Header:gecho --auth username:password\nHTTP/1.1 200 OK\nContent-Encoding: gzip\nContent-Length: 322\nContent-Type: text/plain; charset=utf-8\nDate: Mon, 18 Jul 2022 08:00:57 GMT\nVary: Accept-Encoding\n\n=========================\n|--- REQUEST HEADERS ---|\n=========================\nX-My-Header: gecho\nUser-Agent: HTTPie/2.4.0\nConnection: keep-alive\nContent-Length: 196\nAuthorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\nAccept: */*\nContent-Type: multipart/form-data; boundary=d2a6a71154154fde9698582d2d8b36a8\n\n\n=========================\n|---- REQUEST  BODY ----|\n=========================\n--d2a6a71154154fde9698582d2d8b36a8\nContent-Disposition: form-data; name=\"file\"; filename=\"test.txt\"\nContent-Type: text/plain\n\nThis is the file content\n\n--d2a6a71154154fde9698582d2d8b36a8--\n```\n\nExample by using fetch from the frontend\n\n```js\nconst req = await fetch(\"http://localhost:1337/echo?abc=def\");\n\nconst text = await req.text();\n\nconsole.log(text)\n/*\n=========================\n|--- REQUEST DETAILS ---|\n=========================\nURI: /echo?abc=def\n\n=========================\n|--- REQUEST HEADERS ---|\n=========================\nAccept-Language: nb-NO,nb;q=0.9,no;q=0.8,nn;q=0.7,en-US;q=0.6,en;q=0.5,da;q=0.4,sv;q=0.3\nCache-Control: no-cache\nConnection: keep-alive\nDnt: 1\nPragma: no-cache\nSec-Ch-Ua: \".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"\nUser-Agent: Woohoo\n*/\n```\n\n## Usage\n\n```bash\nHTTP_PORT=1337 gecho\n```\n\nEnvironment variables\n* `HTTP_PORT` default `8080`\n\n## Docker\n\nThe image is available at `bjarneo/gecho:latest`.\n`docker pull bjarneo/gecho:latest`\n\n```bash\n\n# This example we override the HTTP_PORT to port 1337 as a show case\ndocker run -it -p 8080:1337 -e HTTP_PORT=1337 --rm --name gecho bjarneo/gecho:latest\n\n# Now test it with curl\ncurl localhost:8080/echo\n=========================\n|--- REQUEST DETAILS ---|\n=========================\nURI: /echo\n\n=========================\n|--- REQUEST HEADERS ---|\n=========================\nAccept: */*\nUser-Agent: curl/7.79.1\n```\n\n## Kubernetes\n\nI have added an example manifest file `gecho.k8s.yaml`.\n\n```bash\nkubectl apply -f gecho.k8s.yaml\n```\n\n## Build\n\n```bash\ngo build -o bin/gecho\n```\n\n## Releases\n\nHave a look at the releases page for binaries.\n\n## Features?\n\nPlease create an issue\n\n## License\n\nSee [LICENSE](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjarneo%2Fgecho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjarneo%2Fgecho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjarneo%2Fgecho/lists"}