{"id":16293921,"url":"https://github.com/axetroy/forward-cli","last_synced_at":"2025-03-20T03:31:15.968Z","repository":{"id":45229237,"uuid":"441515737","full_name":"axetroy/forward-cli","owner":"axetroy","description":"A command-line tool to reverse proxy any server. 快速反向代理任何网站","archived":false,"fork":false,"pushed_at":"2022-04-06T13:24:22.000Z","size":1549,"stargazers_count":37,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T23:01:43.211Z","etag":null,"topics":["cli","golang","http-proxy"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/axetroy/forward-cli","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/axetroy.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":"2021-12-24T16:55:45.000Z","updated_at":"2025-01-22T14:48:28.000Z","dependencies_parsed_at":"2022-09-05T18:11:52.649Z","dependency_job_id":null,"html_url":"https://github.com/axetroy/forward-cli","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":"axetroy/go-cli-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fforward-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fforward-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fforward-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fforward-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axetroy","download_url":"https://codeload.github.com/axetroy/forward-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047647,"owners_count":20389206,"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":["cli","golang","http-proxy"],"created_at":"2024-10-10T20:13:09.563Z","updated_at":"2025-03-20T03:31:15.411Z","avatar_url":"https://github.com/axetroy.png","language":"Go","readme":"中文简体 | [English](README_en-US.md)\n\n[![Build Status](https://github.com/axetroy/forward-cli/workflows/ci/badge.svg)](https://github.com/axetroy/forward-cli/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/axetroy/forward-cli)](https://goreportcard.com/report/github.com/axetroy/forward-cli)\n![Latest Version](https://img.shields.io/github/v/release/axetroy/forward-cli.svg)\n![License](https://img.shields.io/github/license/axetroy/forward-cli.svg)\n![Repo Size](https://img.shields.io/github/repo-size/axetroy/forward-cli.svg)\n\n## forward-cli\n\n一个命令行工具，反向代理任何网站。例如 Github/Google/Facebook 和其他等. [更多信息](https://github.com/axetroy/blog/issues/634)\n\n![img](screenshot.png)\n\n### 使用\n\n```bash\nforward - A command line tool to quickly setup a reverse proxy server.\n\nUSAGE:\n  forward [OPTIONS] [host]\n\nOPTIONS:\n  --help                              print help information\n  --version                           show version information\n  --address=\"\u003cstring\u003e\"                specify the address that the proxy server listens on. defaults: 0.0.0.0\n  --port=\"\u003cint\u003e\"                      specify the port that the proxy server listens on. defaults: 80\n  --proxy-external                    whether to proxy external host. defaults: false\n  --proxy-external-ignore=\u003chost\u003e      specify the external host without using a proxy. defaults: \"\"\n  --req-header=\"key=value\"            specify the request header attached to the request. Allow multiple flags. defaults: \"\"\n  --res-header=\"key=value\"            specify the response headers. Allow multiple flags. defaults: \"\"\n  --cors                              whether enable cors. defaults: false\n  --overwrite=\u003cfolder\u003e                enable overwrite with a folder. defaults: \"\"\n  --no-cache                          disabled cache for response. defaults: true\n  --tls-cert-file=\u003cfilepath\u003e          the cert file path for enabled tls. defaults: \"\"\n  --tls-key-file=\u003cfilepath\u003e           the key file path for enabled tls. defaults: \"\"\n\nEXAMPLES:\n  forward http://example.com\n  forward --port=80 http://example.com\n  forward --req-header=\"foo=bar\" http://example.com\n  forward --cors --req-header=\"foo=bar\" --req-header=\"hello=world\" http://example.com\n  forward --tls-cert-file=/path/to/cert/file --tls-key-file=/path/to/key/file http://example.com\n```\n\n### 安装\n\n1. [Cask](https://github.com/axetroy/cask.rs)\n\n   ```bash\n   cask install github.com/axetroy/forward-cli\n   ```\n\n2. Shell (Mac/Linux)\n\n   ```bash\n   curl -fsSL https://github.com/release-lab/install/raw/v1/install.sh | bash -s -- -r=axetroy/forward-cli -e=forward\n   ```\n\n3. PowerShell (Windows):\n\n   ```powershell\n   $r=\"axetroy/forward-cli\";$e=\"forward\";iwr https://github.com/release-lab/install/raw/v1/install.ps1 -useb | iex\n   ```\n\n4. [Github release page](https://github.com/axetroy/forward-cli/releases) (全平台)\n\n   下载可执行文件，然后放到 `$PATH` 目录下\n\n5. 使用 [Golang](https://golang.org) 从源码中构建并安装 (全平台)\n\n   ```bash\n   go install github.com/axetroy/forward-cli/cmd/forward@latest\n   ```\n\n### 杂项\n\n1. 如何启用 HTTPS？\n\n要启用 HTTPS，首先先生成 key 和 证书文件\n\n```bash\n# 生成 key\nopenssl genrsa -out server.key 2048\n# 生成证书\nopenssl req -new -x509 -sha256 -key server.key -out server.pem -days 3650\n# 启动代理服务器\nforward --tls-cert-file=server.pem --tls-key-file=server.key http://example.com\n```\n\n2. 自定义代理请求\n\n```bash\n# 代理 https://github.com\nforward https://github.com\n# 发起请求\ncurl http://0.0.0.0:80/api # 实际请求 https://github.com/api\n# 发起自定义代理\ncurl -H \"X-Proxy-Target: https://www.google.com\" http://0.0.0.0/api # 实际请求 https://www.google.com/api\n```\n\n### 开源许可\n\nThe [MIT License](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxetroy%2Fforward-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxetroy%2Fforward-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxetroy%2Fforward-cli/lists"}