https://github.com/aak1247/gproxy
Simple single domain proxy cli tool, supports tcp/websocket/wss/http/https proxy 简单的单点代理命令行工具
https://github.com/aak1247/gproxy
cli http proxy proxy-server tcp websocket
Last synced: 3 months ago
JSON representation
Simple single domain proxy cli tool, supports tcp/websocket/wss/http/https proxy 简单的单点代理命令行工具
- Host: GitHub
- URL: https://github.com/aak1247/gproxy
- Owner: aak1247
- Created: 2023-07-23T19:10:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T11:27:36.000Z (over 1 year ago)
- Last Synced: 2024-09-12T22:45:54.480Z (over 1 year ago)
- Topics: cli, http, proxy, proxy-server, tcp, websocket
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gproxy
| English | [简体中文](./README.zh-CN.md) |
## Install
### With go
```bash
go install github.com/aak1247/gproxy@latest
```
### Binary
See [Releases](https://github.com/aak1247/gproxy/releases/)
## Usage
### Arguments
gproxy [-m mode] [-p port] targetURL
- ``mode``: http or tcp
- ``port``: local port, example: 8080
### Proxy a http website:
``gproxy -m http -p 8080 http://github.com/``
then, a simple http server will run on local 8080 port to serve the content of github.com
#### HTTPS
``gproxy -m https --key keyPath --cert certPath -p 8080 http://github.com/``
### Proxy a tcp service:
``gproxy -m tcp -p 2333 github.com:443``
then, all tcp request to localhost:2333 will be sent to github.com:443 and response from github.com:443 will be sent
back to client
### Proxy a websocket service:
``gproxy -m ws -p 8081 ws://abc.com``
then, a websocket server will run on port 8081 and proxy all ws requests to abc.com. All path and query will be kept and sent to `abc.com`
#### WSS
``gproxy -m wss --key keyPath --cert certPath -p 8081 ws://abc.com``
## Build
### With makefile
``make release VERSION=$VERSION``: will generate all linux/windows/osx binary
### Run by command
#### Target linux
``CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gproxy-linux-amd64``
#### Target windows
``CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o gproxy-windows-amd64.exe``
#### Target mac
``CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o gproxy-darwin-amd64``