gg is a command-line tool for one-click proxy in your research and development.
You can just add gg
before another command to redirect its traffic to your proxy without installing v2ray or anything else. Usage example: gg python -m pip install torch
.
It was inspired by graftcp, is a pure golang implementation with more useful features.
Why did I create go-graft?
I am so tired of the poor network condition in my research and development. But I do not want to install v2ray in the working servers because it is too heavy.
Thus, I need a light and portable command-line tool to help me download and install dependencies and software on various servers.
Advantages
Compared to proxychains or graftcp, we have the following advantages:
- Use it independently without any other proxy utils.
- UDP support.
- Support golang programs. See applications built by Go can not be hook by proxychains-ng .
-
Run this command to download the latest release of go-graft:
# sudo sh -c "$(curl -L https://github.com/mzz2017/gg/raw/main/release/go.sh)" # use the mirror: sudo sh -c "$(curl -L https://hubmirror.v2raya.org/raw/mzz2017/gg/main/release/go.sh)"
Without
sudo
, gg will be installed to the user directory.If the command gg
fails
after installation, check your$PATH
.You can also create a symbolic link to /usr/bin or any other directory in your path.
For example:
sudo ln -s /usr/local/bin/gg /usr/bin/gg
-
Test the installation.
$ gg --version gg version 0.1.1
Examples:
Configure the subscription:
gg config -w subscription=https://example.com/path/to/sub
Test with cloning linux repo:
gg git clone --depth=1 https://github.com/torvalds/linux.git
Output:
Cloning into 'linux'... ... Receiving objects: 100% (78822/78822), 212.19 MiB | 7.04 MiB/s, done. Resolving deltas: 100% (7155/7155), done.
Or just redirect the traffic of whole shell session to your proxy:
gg bash
git clone --depth=1 https://github.com/torvalds/linux.git
curl ipv4.appspot.com
Use share-link
# if no configuration was written before, a share-link will be required to input.
gg wget -O frp.tar.gz https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_amd64.tar.gz
Enter the share-link of your proxy: ******** ... Saving to: ‘frp.tar.gz’ frp.tar.gz 100%[=====================================================>] 8.44M 12.2MB/s in 0.7s 2021-12-06 09:21:08 (12.2 MB/s) - ‘frp.tar.gz’ saved [8848900/8848900]
Or use --node
:
gg --node ss://YWVzLTEyOC1nY206MQ@example.com:17247 speedtest
Retrieving speedtest.net configuration... Testing from Microsoft (13.xx.xx.xx)... ... Hosted by xxx: 55.518 ms Testing download speed................................................................................ Download: 104.83 Mbit/s Testing upload speed...................................................................................................... Upload: 96.35 Mbit/s
Use subscription
By default, gg will automatically select the first available node from the subscription:
gg --subscription https://example.com/path/to/sub docker pull caddy
Using default tag: latest latest: Pulling from library/caddy 97518928ae5f: Pull complete 23ccae726125: Pull complete 3de6a61c89ac: Pull complete 39ed957bdc00: Pull complete 0ae44c2d42dd: Pull complete Digest: sha256:46f11f4601ecb4c5a37d6014ad51f5cbfeb92b70f5c9ec6c2ac39c4c1a325588 Status: Downloaded newer image for caddy:latest docker.io/library/caddy:latest