Shadowsocks-Rust for OpenWrt

February 22, 2022 · View on GitHub

Download Release

简介

本项目是 shadowsocks-rust 在 OpenWrt 上的移植

特性

软件包只包含 shadowsocks-rust 的可执行文件, 可与 luci-app-shadowsocks 搭配使用

  • shadowsocks-rust

    usr/
      └── bin/
          ├── sslocal       // 提供 HTTP/SOCKS 代理, 透明代理, 端口转发(可用于 DNS 查询)
          └── ssurl         // SIP002: ShadowSocks URLs (可选)
          └── ssserver      // 提供 ShadowSocks 服务 (可选)
          └── ssmanager     // 管理 ShadowSocks 服务 (可选)
    

编译

  • 从 OpenWrt 的 SDK 编译

    # 以 ar71xx 平台为例
    tar xjf OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2
    cd OpenWrt-SDK-ar71xx-*
    # 获取 shadowsocks-rust Makefile
    git clone https://github.com/honwen/openwrt-shadowsocks-rust.git package/shadowsocks-rust
    # 选择要编译的包 Network -> shadowsocks-rust
    make menuconfig
    # 开始编译
    make package/shadowsocks-rust/compile V=99
    

配置

软件包本身并不包含配置文件, 配置文件内容为 JSON 格式, 支持的键:

键名数据类型说明
server字符串服务器地址, 可以是 IP 或者域名
server_port整数值服务器端口号
local_address字符串本地绑定的 IP 地址, 默认 127.0.0.1
local_port整数值本地绑定的端口号
password字符串服务端设置的密码
method字符串加密方式, 详情参考
timeout整数值超时时间(秒), 默认 60
plugin字符串插件名称, eg: v2ray-plugin
plugin_opts字符串插件参数, eg: tls;host=www.bing.com;path=/websocket
nofile整数值设置 Linux ulimit
mode枚举值转发模式, 可用值: [tcp_only, udp_only, tcp_and_udp]