Once installed, you can access blinksocks via CLI:
$ blinksocks --help
blinksocks v2.7.0
Usage: blinksocks [command] [options] ...
Commands:
init generate configuration pair
Options:
-h, --help output usage information
-v, --version output blinksocks version
-c, --config file json file with configuration
-m, --minimal generate minimal json files
-w, --write overwrite previous json files
--list-presets list all built-in presets
Examples:
- Generate json file with minimal options
$ blinksocks init --minimal
- Start blinksocks client
$ blinksocks --config blinksocks.client.json
- Start blinksocks server
$ blinksocks --config blinksocks.server.json
- List all built-in presets
$ blinksocks --list-presets
About & Help: https://github.com/blinksocks/blinksocks
blinksocks init
will generate blinksocks.client.json
and blinksocks.server.json
with a random key/port/timeout and default settings.
After init, you should edit blinksocks.client.json
to tell blinksocks client where is the server:
{
"servers": [{
"service": "tcp://<server_address>:<server_port>",
...
}]
}
You may also want to change default protocol stack(presets) or other settings, please check out --config for explanation of every option.
NOTE: you can only use pm2 on Linux/macOS due to a bug of pm2 on Windows. #93
You can take advantages of pm2 to run blinksocks in the production.
Install pm2
before running blinksocks in the production:
$ npm install -g pm2
Daemon mode
$ pm2 start blinksocks -- -c blinksocks.client.json
Cluster mode
$ pm2 start blinksocks -i 2 -- -c blinksocks.server.json
// download archive
$ wget https://github.com/blinksocks/blinksocks/releases/download/v2.5.3/blinksocks-linux-x64-v2.5.3.gz
// you'd better check sha256sum listed in sha256sum.txt
$ wget https://github.com/blinksocks/blinksocks/releases/download/v2.5.3/sha256sum.txt
// decompress
$ gunzip blinksocks-linux-x64-v2.5.3.gz
// grant executable permission
$ chmod +x blinksocks-linux-x64-v2.5.3
// run directly
$ ./blinksocks-linux-x64-v2.5.3 --help
You may want to use blinksocks to surf the Internet with browsers, so I give an advise here.
For Google Chrome, SwitchyOmega extension is a great approach to proxy your connections by rules to blinksocks via socks5/socks4(a)/http.
For FireFox, you can configure proxy at Preferences - Advanced - Network - Settings
.
We can use Docker to auto-deploy a blinksocks server.
You can build an image manually or pull it from docker hub:
- Build an image
$ cd <project-folder>/deploy
$ docker build --tag <user>/blinksocks:<version> --no-cache .
- Pull from docker hub
$ docker pull blinksocks:<version>
Container will expose 1080
port, so you must map a host port to 1080
via -p
.
$ docker run -d -p 7777:1080 blinksocks:<version>