{"id":17355169,"url":"https://github.com/zephinzer/go-proxy-gzip","last_synced_at":"2026-05-04T20:39:15.467Z","repository":{"id":79926643,"uuid":"172001028","full_name":"zephinzer/go-proxy-gzip","owner":"zephinzer","description":"Proxy server that compresses your request with gzip before sending it on its way","archived":false,"fork":false,"pushed_at":"2019-09-18T09:34:23.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:17:03.437Z","etag":null,"topics":["docker","docker-image","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/zephinzer.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":"2019-02-22T05:39:01.000Z","updated_at":"2019-09-18T09:32:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"2575984a-f71d-4f70-93cf-9ddc0af651a5","html_url":"https://github.com/zephinzer/go-proxy-gzip","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/zephinzer/go-proxy-gzip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgo-proxy-gzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgo-proxy-gzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgo-proxy-gzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgo-proxy-gzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephinzer","download_url":"https://codeload.github.com/zephinzer/go-proxy-gzip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgo-proxy-gzip/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261906776,"owners_count":23228348,"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":["docker","docker-image","golang","proxy-server"],"created_at":"2024-10-15T17:42:32.274Z","updated_at":"2026-05-04T20:39:10.436Z","avatar_url":"https://github.com/zephinzer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProxyGzip\nA proxy service that assists in compressing your requests via gzip.\n\n\u003e Note: As of 22nd February 2019, this component is actively maintained but inactively upgraded\n\n# Why this exists\n\nSome policies enforce analysis of ingoing and outgoing through decoding of body data. A method needed to be devised to re-encode this data upon exiting the internal network before hitting the final destination.\n\nThis is it.\n\n# Usage\n\n## How it works\nThis server takes in any request and transforms the request so that:\n1. The body data is compressed with `gzip`\n1. The `Content-Length` header will be set to the length of the `gzip`ped content\n1. The `Content-Encoding` header will be set to `\"gzip\"`\n1. The `Content-Type` header will be derived from your data, or if the `CONTENT_TYPE` environment variable is set, that\n1. All other headers sent are re-constructed from the original client request and forwarded to the next hop server **AS-IS**\n\nThe transformed request is then forwarded to the next hop server and a response is received. This response is processed such that:\n1. The next hop response headers will be reflected in the response to the client **AS-IS**\n1. The client request headers will be reflected in the response headers prefixed with `pgz-request-*`\n1. The proxy server configuration will be reflected in the response headers prefixed with `pgz-config-*`\n\n## Configuration\n\n### Application Environment Variables\nUse the following variables to configure the application.\n\n| Environment Variable | Description | Example |\n| --- | --- | --- |\n| `ADDR` | Network interface for proxy server to listen on | `\"0.0.0.0\"` |\n| `APP_ID` | ID of the application to reflect in the logs | `\"goproygzip\"` |\n| `CONTENT_TYPE` | Forces the proxied `Content-Type` header to whatever you want. Useful for when the MIME type cannot automatically be detected | `\"application/some-custom-format\"` |\n| `FLUENTD_HOST` | Hostname of the FluentD service | `\"somefluentd\"` |\n| `FLUENTD_INIT_RETRY_COUNT` | Number of times the logger should retry reconnecting to the FluentD service | `50` |\n| `FLUENTD_INIT_RETRY_INTERVAL` | Duration between the logger's attempt to connect to the FluentD service | `\"somefluentd\"` |\n| `FLUENTD_PORT` | Port which the FluentD service is listening on | `\"24224\"` |\n| `FORWARD_TO` | URL to forward to. When this is left empty, the service will simply be an echo server that echoes what it will sent to the next hop server if `FORWARD_TO` had been specified. | `\"https://my.api.somewhere.com\"` |\n| `LOG_FORMAT` | Sets the logs to the format you desire for development/production. | `\"text\"`, or `\"json\"` |\n| `PORT` | Port for proxy server to listen on | `\"1337\"` |\n\n## Deployment\n\n### Docker Compose\nSee [the example file](./deploy/docker/docker-compose.yml).\n\n### Kubernetes\nSee [the example manifests](./deploy/kubernetes).\n\n## Response Interpretation\n\n### Status Code\nThe status code will reflect the status code of the next hop response.\n\n### Headers\nHeaders prefixed with `pgz-config-` display the configuration of the ProxyGzip server.\n\nHeaders prefixed with `pgz-request-` display headers from the client's request.\n\nHeaders not prefixed are headers from the next hop server.\n\n# Contributing\n- Development tooling is performed via the Makefile.\n- Dependency management is done via Go Modules (from Go 1.11)\n- Non-collabs: Fork, make changes on your fork's `master` branch, and then issue a pull request back for changes\n- Collabs: Make changes on a branch other than `master`, issue a merge request\n- For quickening the process/if this repo seems dead, ping [the maintainers](./MAINTAINERS)\n\n## Running locally\n\n```sh\nmake\n```\n\n## (Manually) Getting dependencies in\n\n\u003e The `make start`/`make` recipe already does this for you before running the application\n\n```sh\nmake deps\n```\n\n## Running tests\n\n```sh\nmake test\n```\n\n## Binary generation (compilation)\n\n```sh\n# compiles for all operating systems and architectures\nmake compile\n\n# for windows\nmake compile.windows\n\n# for macos\nmake compile.macos\n\n# for linux\nmake compile.linux\n```\n\n## Bundling Docker image for production\n\n```sh\nmake package\n```\n\n## Publish Docker image\n\n```sh\nmake release\n```\n\n## Continuous Integration Configuration\n\n### Available pipelines\nCurrently, there exists integrations for:\n\n- GitLab CI (for GitLab hosting)\n- TraviS CI (for GitHub hosting)\n\n### Environment setup\n\n#### Generating SSH Deploy Keys\nRun the following to generate a set of keys to use for your deploy keys:\n\n```sh\nmake ssh.keys\n```\n\nYou can find the keys in the `./bin` directory as `id_rsa` (the private key) and `id_rsa.pub` (the public key). There should also be a Base 64 encoded version of the private key named `id_rsa.b64` which you can copy the contents and paste into the relevant `x_SSH_DEPLOY_KEY` in [the Pipeline Environment Variables table below](#pipeline-environment-variables).\n\n#### Inserting SSH Deploy Keys - GitHub\nGo to your repository and click on **Settings \u003e Deploy keys** and hit the **Add deploy key** button on the top right of the page. Paste the contents of `id_rsa.pub` there as the key. **Note: do not base64 encode this one**.\n\n#### Inserting SSH Deploy Keys - GitLab\nGo to your repository's side menu in **Settings \u003e Repository \u003e Deploy Keys** and add the contents of `id_rsa.pub` there as the key. **Note: do not base64 encode this one**.\n\n#### Pipeline Environment Variables\nBefore running the CI pipeline, you need to input the following build pipeline variables:\n\n| Environment Variable | Description | Example |\n| --- | --- | --- |\n| `BINARY_FILENAME` | Filename for the binary | `\"proxy-gzip\"` |\n| `DOCKER_REGISTRY_HOSTNAME` | Hostname for the Docker registry | `\"docker.io\"` |\n| `DOCKER_REGISTRY_USERNAME` | *Optional*: Username for the Docker registry (if not present, the job will be skipped) | `\"username\"` |\n| `DOCKER_REGSITRY_PASSWORD` | *Optional*: Password for the Docker registry (if not present, the job will be skipped) | `\"password123\"` |\n| `DOCKER_IMAGE_NAMESPACE` | docker.io/**THIS**/image:tag | `\"zephinzer\"` |\n| `DOCKER_IMAGE_NAME` | docker.io/namespace/**THIS**:tag | `\"proxy-gzip\"` |\n| `GITHUB_REPOSITORY_URL` | When present, bumps the patch version and  *Optional*: SSH URL of the GitHub repository to release to, if not present, releasing to GitHub will be skipped | `\"git@github.com:zephinzer/go-proxy-gzip.git\"` |\n| `GITHUB_SSH_DEPLOY_KEY` | Base64 encoded deploy key for the GitHub repository *Optional*: Only in play when `GITHUB_REPOSITORY_URL` is specified. | `\"\"` |\n| `GITHUB_OAUTH_TOKEN` | *Optional*: When specified, deploys the built binaries to GitHub under releases. | `\"\"` |\n| `GITLAB_REPOSITORY_URL` | *Optional*: SSH URL of the GitLab repository to release to, if not present, releasing to GitLab will be skipped | `\"git@gitlab.com:zephinzer/go-proxy-gzip.git\"` |\n| `GITLAB_SSH_DEPLOY_KEY` | Base64 encoded deploy key for the GitHub repository *Optional*: Only in play when `GITLAB_REPOSITORY_URL` is specified. | `\"\"` |\n| `VERSION_BUMP` | *Optional*: One of \"patch\", \"minor\", or \"major\". Only of use if either the GitHub or GitLab URL is specified. Indicates whether the semver version bump should be a patch, minor, or major one accordingly | `\"patch\"` |\n\n# TODOS\n\n- Healthchecks to verify next hop server is alive\n- Healthchecks to verify self-health \n- Distributed tracing\n- ~~Logs collation~~\n\n\u003e (help anyone?)\n\n# License\nThis project is licensed under the [MIT license](./LICENSE).\n\n# Cheers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fgo-proxy-gzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephinzer%2Fgo-proxy-gzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fgo-proxy-gzip/lists"}