From 488987927d58403207bff9c1fbb7d9d2ccf92ad7 Mon Sep 17 00:00:00 2001 From: Xiaoding Liu Date: Fri, 25 Oct 2019 13:28:31 +0800 Subject: [PATCH] Update FreeBSD section Update FreeBSD section, including install / configuration / run / run as client. --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e2ef2982..44a853ad 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ sudo snap install shadowsocks-libev --edge - [Nix](#nix) - [Directly build and install on UNIX-like system](#linux) - [FreeBSD](#freebsd) + + [Install](#install) + + [Configuration](#configuration) + + [Run](#run) + + [Run as client](#run-as-client) - [OpenWRT](#openwrt) - [OS X](#os-x) - [Windows (MinGW)](#windows-mingw) @@ -294,27 +298,49 @@ sudo make install You may need to manually install missing softwares. ### FreeBSD +#### Install +Shadowsocks-libev is available in FreeBSD Ports Collection. You can install it in either way, `pkg` or `ports`. + +**pkg (recommended)** + +```bash +pkg install shadowsocks-libev +``` + +**ports** ```bash -su cd /usr/ports/net/shadowsocks-libev make install ``` -Edit your config.json file. By default, it's located in /usr/local/etc/shadowsocks-libev. +#### Configuration +Edit your `config.json` file. By default, it's located in `/usr/local/etc/shadowsocks-libev`. -To enable shadowsocks-libev, add the following rc variable to your /etc/rc.conf file: +To enable shadowsocks-libev, add the following rc variable to your `/etc/rc.conf` file: ``` shadowsocks_libev_enable="YES" ``` +#### Run + Start the Shadowsocks server: ```bash service shadowsocks_libev start ``` +#### Run as client +By default, shadowsocks-libev is running as a server in FreeBSD. If you would like to start shadowsocks-libev in client mode, you can modify the rc script (`/usr/local/etc/rc.d/shadowsocks_libev`) manually. + +``` +# modify the following line from "ss-server" to "ss-local" +command="/usr/local/bin/ss-local" +``` + +Note that is simply a workaround, each time you upgrade the port your changes will be overwritten by the new version. + ### OpenWRT The OpenWRT project is maintained here: