-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
126 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,33 +13,50 @@ Here is an incomplete list of supported commands: | |
* gem | ||
* npm | ||
* mvn | ||
* ssh | ||
* ... | ||
|
||
## Usage | ||
|
||
1. Clone the code. | ||
```bash | ||
git clone https://github.com/zjx20/socks-cli.git | ||
``` | ||
|
||
2. Copy `socksproxyenv.sample` to `socksproxyenv`, and fill your socks5 server into it. | ||
```bash | ||
cd socks-cli | ||
cp socksproxyenv.sample socksproxyenv | ||
|
||
# edit socksproxyenv, complete the line: | ||
# export SOCKS_PROXY= | ||
``` | ||
|
||
3. Call `source socks-cli/activate` before your CLI commands: | ||
3. Invoke `source socks-cli/activate` before running your CLI commands: | ||
``` | ||
$ source socks-cli/activate | ||
Serving HTTP proxy on 127.0.0.1 port 54967 ... | ||
Done! Some environment variables have been changed to: | ||
Done! Variables or aliases have been changed to: | ||
GIT_PROXY_COMMAND=/Users/x/socks-git/sh/socksified-connect.sh | ||
GIT_SSH=/Users/x/socks-git/sh/socksified-ssh.sh | ||
ALL_PROXY=socks5h://127.0.0.1:1080 | ||
HTTP_PROXY=http://127.0.0.1:54967 | ||
HTTPS_PROXY=http://127.0.0.1:54967 | ||
|
||
# Following commands will use the socks proxy! | ||
|
||
$ git clone [email protected]:git/git.git | ||
Cloning into 'git'... | ||
remote: Counting objects: 213208, done. | ||
remote: Compressing objects: 100% (372/372), done. | ||
Receiving objects 2.0% (1/213208), 620.00 KiB | 121.00 KiB/s | ||
... | ||
|
||
# Check your external IP! | ||
$ curl ipinfo.io | ||
... | ||
``` | ||
|
||
4. Optionally, you can call `source socks-cli/deactivate` to deactivate `socks-cli`. | ||
4. Optionally, you can invoke `source socks-cli/deactivate` to deactivate `socks-cli`. | ||
|
||
For more details, please see [socksproxyenv.sample](socksproxyenv.sample). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
# The shebang is just a hint for editors. | ||
|
||
SHADOW ssh "${SOCKS_CLI_DIR}/sh/socksified-ssh.sh" |