Total Pageviews

Sunday, 3 June 2018

安装shadowsocksr-native

登录linux vps,然后
wget https://cmake.org/files/v3.10/cmake-3.10.1.tar.gz
tar zxvf cmake-3.10.1.tar.gz
cd cmake-3.10.1
./configure
make
make install

apt-get install build-essential autoconf libtool asciidoc xmlto -y
(安装asciidoc会占用1.3gb的空间,所以本文的方法太消耗空间,不推荐使用。)
apt-get install git gcc g++ automake -y
apt-get -f install
git clone https://github.com/ShadowsocksR-Live/shadowsocksr-native
cd shadowsocksr-native
git submodule update --init
mkdir build && cd build && cmake .. && make
(make时,会显示:
 Linking C executable ssr-server
...
 Linking C executable ssr-client

root@ar:~/shadowsocksr-native/build# ls
CMakeCache.txt    Makefile         config.h  libcork     libudns
CMakeFiles    cmake_install.cmake  depends   libipset  src
root@ar:~/shadowsocksr-native/build# find . -name ssr-server
./src/ssr-server
(在src目录下,生成了可执行文件ssr-server)
root@ar:~/shadowsocksr-native/build# cd src
root@ar:~/shadowsocksr-native/build/src# ls
CMakeFiles  Makefile  cmake_install.cmake  ssr-client  ssr-local  ssr-server
root@ar:~/shadowsocksr-native/build/src# ./ssr-server -h
ShadowsocksR native server

Usage:

  ssr-server [-d] [-c <config file>] [-h]

Options:

  -d                     Run in background as a daemon.
  -c <config file>       Configure file path.
                         Default: /etc/ssr-native/config.json
  -h                     Show this help message.
(文件/etc/ssr-native/config.json并不存在,所以不用理它)
root@ar:~/shadowsocksr-native/build/src# cp ~/shadowsocksr-native/config.json ./
root@ar:~/shadowsocksr-native/build/src# nano config.json
root@ar:~/shadowsocksr-native/build/src# cat config.json
{
    "server": "0.0.0.0",
    "server_port": 9443,
    "method": "aes-256-cfb",
    "password": "my-password",
    "protocol": "origin", // "auth_aes128_md5",
    "protocol_param": "",
    "obfs": "plain", // "tls1.2_ticket_auth",
    "obfs_param": "",
    "local_address": "127.0.0.1",
    "local_port": 1080,
    "udp": true,
    "timeout": 300
}
root@ar:~/shadowsocksr-native/build/src# ./ssr-server -c config.json -d
服务器端就搭建好了。

客户端。见此:https://github.com/erguotou520/electron-ssr/releases/,
mac系统,下载https://github.com/erguotou520/electron-ssr/releases/download/v0.2.3/electron-ssr-0.2.3.dmg
windows系统,下载https://github.com/erguotou520/electron-ssr/releases/download/v0.2.3/electron-ssr-setup-0.2.3.exe
安装好后,填入相关参数。
or: ShadowsocksX-NGShadowsocksX-R

项目地址:https://github.com/ShadowsocksR-Live/shadowsocksr-native
不过这个shadowsocksr-native依赖libuv,不太robust.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.