Upgrade kcptun to version v20190905.
Use origin kcptun binary with an adapter script.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
\f0\fs24 \cf0 ss-local}}
|
||||
\f0\fs24 v3.2.5\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/shadowsocks/kcptun"}}{\fldrslt \cf0 kcptun}} v20170718\
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/shadowsocks/kcptun"}}{\fldrslt \cf0 kcptun}} v20190905\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/shadowsocks/simple-obfs"}}{\fldrslt \cf0 simple-obfs}} v0.0.5\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
import Foundation
|
||||
|
||||
let SS_LOCAL_VERSION = "3.2.5"
|
||||
let KCPTUN_CLIENT_VERSION = "v20170718"
|
||||
let KCPTUN_CLIENT_VERSION = "v20190905"
|
||||
let V2RAY_PLUGIN_VERSION = "1.1.0"
|
||||
let PRIVOXY_VERSION = "3.0.26.static"
|
||||
let SIMPLE_OBFS_VERSION = "0.0.5_1"
|
||||
@ -225,7 +225,7 @@ func InstallKcptun() {
|
||||
let fileMgr = FileManager.default
|
||||
let homeDir = NSHomeDirectory()
|
||||
let appSupportDir = homeDir+APP_SUPPORT_DIR
|
||||
if !fileMgr.fileExists(atPath: appSupportDir + "kcptun_\(KCPTUN_CLIENT_VERSION)/kcptun_client") {
|
||||
if !fileMgr.fileExists(atPath: appSupportDir + "kcptun_\(KCPTUN_CLIENT_VERSION)/client") {
|
||||
let bundle = Bundle.main
|
||||
let installerPath = bundle.path(forResource: "install_kcptun", ofType: "sh")
|
||||
let task = Process.launchedProcess(launchPath: "/bin/sh", arguments: [installerPath!])
|
||||
|
||||
BIN
ShadowsocksX-NG/kcptun/client
Executable file
BIN
ShadowsocksX-NG/kcptun/client
Executable file
Binary file not shown.
@ -4,17 +4,23 @@
|
||||
# ShadowsocksX-NG
|
||||
#
|
||||
# Created by 邱宇舟 on 2018/9/21.
|
||||
# Copyright © 2018年 qiuyuzhou. All rights reserved.
|
||||
# Copyright © 2018-2019年 qiuyuzhou. All rights reserved.
|
||||
|
||||
# https://github.com/shadowsocks/kcptun/releases
|
||||
# Use kcptune bianry from here which is not support SIP003.
|
||||
# We use an adatper to handle it.
|
||||
# https://github.com/xtaci/kcptun/releases
|
||||
|
||||
VERSION="v20170718"
|
||||
VERSION="v20190905"
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION"
|
||||
cp -f kcptun_client "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION/"
|
||||
cp -f client "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION/"
|
||||
|
||||
ln -sfh "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION/kcptun_client" "$HOME/Library/Application Support/ShadowsocksX-NG/plugins/kcptun"
|
||||
# Delete old kcptun symbol link
|
||||
rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/plugins/kcptun"
|
||||
|
||||
# Copy adapter shell script to plugin folder
|
||||
cp -f kcptun.sh "$HOME/Library/Application Support/ShadowsocksX-NG/plugins/kcptun"
|
||||
|
||||
echo "install kcptun done"
|
||||
|
||||
43
ShadowsocksX-NG/kcptun/kcptun.sh
Executable file
43
ShadowsocksX-NG/kcptun/kcptun.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# A shadowsocks SIP003 adapter shell script.
|
||||
#
|
||||
# SIP003 Docucment: https://github.com/shadowsocks/shadowsocks-org/issues/28
|
||||
#
|
||||
# Created by Qiu Yuzhou on 2019-09-09
|
||||
# Copyright © 2019 Qiu Yuzhou. All rights reserved.
|
||||
|
||||
# test data, Start
|
||||
# SS_REMOTE_HOST=127.0.0.1
|
||||
# SS_REMOTE_PORT=8088
|
||||
# SS_LOCAL_HOST=192.168.1.1
|
||||
# SS_LOCAL_PORT=888
|
||||
# test data, End
|
||||
|
||||
SS_ENV_NAMES=(SS_REMOTE_HOST SS_REMOTE_PORT SS_LOCAL_HOST SS_LOCAL_PORT)
|
||||
|
||||
for i in "${SS_ENV_NAMES[@]}"; do
|
||||
if [ -z ${!i} ]
|
||||
then
|
||||
echo Not found env variable $i
|
||||
exit
|
||||
fi
|
||||
done
|
||||
|
||||
# Split options
|
||||
IFS=';' read -ra _OPTS <<< "${SS_PLUGIN_OPTIONS}"
|
||||
|
||||
# Prepend `--`
|
||||
OPTS=()
|
||||
for i in "${_OPTS[@]}"; do
|
||||
OPTS+=("--$i")
|
||||
done
|
||||
|
||||
PLUGIN_NAME="kcptun"
|
||||
PLUGIN_VERSION="v20190905"
|
||||
PLUGIN_BINARY_NAME="client"
|
||||
|
||||
CMD="$(dirname "${BASH_SOURCE[0]}")/../${PLUGIN_NAME}_${PLUGIN_VERSION}/${PLUGIN_BINARY_NAME}"
|
||||
|
||||
# Update this line when adapted other plugin.
|
||||
"$CMD" -r "${SS_REMOTE_HOST}:${SS_REMOTE_PORT}" -l "${SS_LOCAL_HOST}:${SS_LOCAL_PORT}" ${OPTS[@]}
|
||||
Binary file not shown.
Reference in New Issue
Block a user