lede icon indicating copy to clipboard operation
lede copied to clipboard

【已解决】Shadowsocks New Version 加入 obfs=tls

Open jyy5206 opened this issue 6 years ago • 52 comments

@coolsnowwolf

首先感谢您的奉献,让我学会了自己编译。(本人非 IT 业者)

我的机场本来仅提供【纯 SS】 服务。 从 2019 年国庆起,机场逐渐把【纯 SS】改为了【SS + obfs=tls】。 从昨天起,基本上都改为了【SS + obfs=tls】。

能否帮忙把 obfs=tls 功能加入到 Shadowsocks New Version 里?

不情之请,请多包涵。

谢谢!

jyy5206 avatar Jan 25 '20 15:01 jyy5206

需要这种方式的话建议用V2,单独的SS+obfs不太推荐了。

dolphinpaopao avatar Jan 25 '20 15:01 dolphinpaopao

谢谢跟帖。

完全理解并赞同您的意见。

我的机场 = Justmysocks = 小众,他们没有 V2Ray 的服务 :( 所以我的需求=小众,况且此项目是 Mr. Lean 业余时间自愿免费在开发/维护,我自己都觉得很不好意思。。。

我尝试过在R9.12.31版本中,手动安装了 simple-obfs,可是在 Shadowsocks New Version 添加/编辑服务器配置中,并没有蹦出来 obfs 的选择框。:(

所以只能求助于您们专业人士了。

不管结果如何,都表示诚挚的感谢!

jyy5206 avatar Jan 25 '20 16:01 jyy5206

这个需要适配,尝试right论坛上编译的魔改固件看是否有相关功能。 另外可以参考这篇文章源自Google获取:http://blog.kompaz.win/2019/01/13/20190113%20OpenWRT%E5%8D%87%E7%BA%A7%E5%88%B018.06.1/

dolphinpaopao avatar Jan 26 '20 06:01 dolphinpaopao

谢谢! 我先学习下。 有问题再来请教。

jyy5206 avatar Jan 26 '20 07:01 jyy5206

同用Justmysocks,上个月发工单报故障,建议官方加入v2ray和trojan协议,至令没回应,反面3号服务器也改用了 obfs=tls这种方式

qdfansanyblog avatar Jan 27 '20 10:01 qdfansanyblog

哈哈,瓦工鸡场,用原版ss官方1907编译吧,还行,n1的防火墙也不用加什么规则

hcym avatar Jan 27 '20 12:01 hcym

我刚刚也给 Justmysocks 发了 Ticket,建议增加 V2Ray 。 多一个人反应,应该多一份效果吧。 看看有没有效果。。。

jyy5206 avatar Jan 27 '20 13:01 jyy5206

JMS回复倒挺快。 态度 = No 。

We do not limit on what devices you use our services. However unfortunately we are not able to provide specific instructions for such custom setups.

Note: I am a robot and my reply is based on the information provided in the ticket, as well as diagnostics data I have access to. If your request was not properly addressed, please reply in this ticket and one of our engineers will take a look.

Thank you.

用来用去,在路由器上,还是觉得 Mr. Lean 的版本最快,设置起来也快。 还望各位大佬帮忙加入 obfs 下。 谢谢!

jyy5206 avatar Jan 27 '20 14:01 jyy5206

担心多余,混淆都没必要,瓦工机场速度和我的v3一样,我自己搭建的就是不如v2,上次封的那么多,机场没事,ip也就是同段的换了几次

hcym avatar Jan 27 '20 14:01 hcym

2个没想到: 1)Justmysocks 用户这里也有; 2)SS+obfs 组合竟然正在变成主流。

看大佬们是否有空增加 SS+obfs 的组合了。。。

不好意思白嫖。如何让我能捐献几杯咖啡?

jyy5206 avatar Jan 28 '20 08:01 jyy5206

看看恩山这位网友的帖子 https://www.right.com.cn/forum/thread-1632897-1-1.html

lyin888 avatar Jan 31 '20 00:01 lyin888

https://github.com/honwen/openwrt-v2ray-plugin

lyin888 avatar Jan 31 '20 00:01 lyin888

1、https://github.com/bigbighill/lede 集成了 v2ray-plugin 及openplash 支持 obfs参数填入位置见图片

IMG_20200201_160658 2、也可使用 openclash,以clash 支持ss +plugin 3、已加入github active workflow,可自行修改。

bigbighill avatar Feb 01 '20 08:02 bigbighill

看看恩山这位网友的帖子 https://www.right.com.cn/forum/thread-1632897-1-1.html

@lyin888 您好!

感谢您的指导! 根据此贴,我照做了。

结果:头几分钟可以使用SS+obfs了,之后就不行了。症状为红色字体“ShadowsocksR Plus+ 未运行”始终出现。无论如何折腾,都无法出现绿色”ShadowsocksR Plus+ 运行中“。 哪怕重启路由也没用。

细节: 我是 R9.12.31 版本,Netgear 4300V1 路由。 obfs插件:http://openwrt-dist.sourceforge.net/packages/base/mips_24kc/simple-obfs_0.0.5-4_mips_24kc.ipk opkg install 之后,看到 /usr/bin 里有 obfs-local 了,应该是安装成功了。

vi /usr/lib/lua/luci/model/cbi/shadowsocksr/client-config.lua : (中间2段是额外插入的代码)

o = s:option(Value, "server_port", translate("Server Port")) o.datatype = "port" o.rmempty = false

o = s:option(Value, "plugin", "Plugin") o:depends("type", "ss")

o = s:option(Value, "plugin_opts", "Plugin Opts") o:depends("type", "ss")

-- o = s:option(Value, "timeout", translate("Connection Timeout")) -- o.datatype = "uinteger" -- o.default = 60 -- o.rmempty = false

之后,在“编辑服务器配置”页面,成功出现了 Plugin 和 Plugin Opts 二个输入框。

然后 vi /etc/init.d/shadowsocksr : (local plugin=$..... 起,到 fi ,是额外插入的代码)

if [ "$stype" == "ss" ] ;then cat <<-EOF >$config_file { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), "local_address": "0.0.0.0", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), "method": "$(uci_get_by_name $1 encrypt_method_ss)", "reuse_port": true, "fast_open": $fastopen local plugin=$(uci_get_by_name $1 plugin) if [ -n "$plugin" -a -x "/usr/bin/$plugin" ]; then sed -i "s@$hostip",@$hostip",\n "plugin": "$plugin",\n "plugin_opts": "$(uci_get_by_name $1 plugin_opts)",@" $config_file fi } EOF elif [ "$stype" == "ssr" ] ;then cat <<-EOF >$config_file

麻烦您有空帮我看下,我哪里做得不对?

谢谢!

jyy5206 avatar Feb 01 '20 14:02 jyy5206

@bigbighill 您好!

您的指导看到了,谢谢! 好多地方不懂。 为不打扰您的时间,我先自己学习下。 等7788有个数之后,再以最少的问题,花您最少的时间,来请教您。 祝好!

jyy5206 avatar Feb 01 '20 14:02 jyy5206

if [ "$stype" == "ss" ] ;then cat <<-EOF >$config_file { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), "local_address": "0.0.0.0", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), "method": "$(uci_get_by_name $1 encrypt_method_ss)", "reuse_port": true, "fast_open": $fastopen local plugin=$(uci_get_by_name $1 plugin) if [ -n "$plugin" -a -x "/usr/bin/$plugin" ]; then sed -i "s@$hostip",@$hostip",\n "plugin": "$plugin",\n "plugin_opts": "$(uci_get_by_name $1 plugin_opts)",@" $config_file fi } EOF

if [ "$stype" == "ss" ] ;then cat <<-EOF >$config_file { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), "local_address": "0.0.0.0", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), "method": "$(uci_get_by_name $1 encrypt_method_ss)", "reuse_port": true, "fast_open": $fastopen } EOF local plugin=$(uci_get_by_name $1 plugin) if [ -n "$plugin" -a -x "/usr/bin/$plugin" ]; then sed -i "s@$hostip",@$hostip",\n "plugin": "$plugin",\n "plugin_opts": "$(uci_get_by_name $1 plugin_opts)",@" $config_file fi

bigbighill avatar Feb 01 '20 17:02 bigbighill

另外在 /etc/inti.d/shadowoskr 最后部分添加 killall -q -9 v2ray-plugin

参见 https://github.com/bigbighill/lede/blob/master/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr

bigbighill avatar Feb 01 '20 17:02 bigbighill

尊敬的 @bigbighill ,

非常感谢您的指导! 按照您的教程,成功用上了 SS+obfs 组合!

另外在 /etc/inti.d/shadowoskr 最后部分添加 killall -q -9 v2ray-plugin

这个我没执行。 因为: 1)系统已顺利运行; 2)我的插件是obfs,不是v2ray。

再次感谢!

jyy5206 avatar Feb 02 '20 14:02 jyy5206

姨,谢谢分享,我也试试看看,瓦工就有一个节点最快,用的混淆,目前用的原版ss,没大雕的方便

hcym avatar Feb 02 '20 14:02 hcym

感谢 @bigbighill @lyin888 和众多专家的指导,成功用上了 SS+obfs 组合!

我从本项目索取颇多,反哺回报为必须。

总结路线图如下,供其他有需要的朋友参考:

环境: R9.12.31 Netgear 4300V1

步骤: 1)进入 Openwrt web页面:系统 => 软件包

2)【下载并安装软件包】的框里输入: http://openwrt-dist.sourceforge.net/packages/base/mips_24kc/simple-obfs_0.0.5-4_mips_24kc.ipk 点击确认。数秒钟后页面顶部会提示安装完毕。 (此为安装obfs插件)

3)更改文件 vi /usr/lib/lua/luci/model/cbi/shadowsocksr/client-config.lua 第145行起,插入额外代码(中间2段浅灰字体) 我把上下文也列出来了,可有效避免小白(如我)插错地方。

o = s:option(Value, "server_port", translate("Server Port")) o.datatype = "port" o.rmempty = false

o = s:option(Value, "plugin", "Plugin") o:depends("type", "ss")

o = s:option(Value, "plugin_opts", "Plugin Opts") o:depends("type", "ss")

-- o = s:option(Value, "timeout", translate("Connection Timeout")) -- o.datatype = "uinteger" -- o.default = 60 -- o.rmempty = false

和我环境相同的,可直接使用我自己修改好的文件,来替换原文件。 下载: https://raw.githubusercontent.com/jyy5206/SS_obfs/master/client-config.lua

4)更改文件 vi /etc/init.d/shadowsocksr 第105行起,插入额外代码(最下面5段浅灰字体) 我把上下文也列出来了,可有效避免小白(如我)插错地方。

if [ "$stype" == "ss" ] ;then
cat <<-EOF >$config_file
{
"server": "$hostip",
"server_port": $(uci_get_by_name $1 server_port),
"local_address": "0.0.0.0",
"local_port": $(uci_get_by_name $1 local_port),
"password": "$(uci_get_by_name $1 password)",
"timeout": $(uci_get_by_name $1 timeout 60),
"method": "$(uci_get_by_name $1 encrypt_method_ss)",
"reuse_port": true,
"fast_open": $fastopen
}
EOF

local plugin=$(uci_get_by_name $1 plugin)
if [ -n "$plugin" -a -x "/usr/bin/$plugin" ]; then
    sed -i "s@$hostip\",@$hostip\",\n    \"plugin\": \"$plugin\",\n    \"plugin_opts\": \"$(uci_get_by_name $1 plugin_opts)\",@" $config_file
fi

和我环境相同的,可直接使用我自己修改好的文件,来替换原文件。 下载: https://raw.githubusercontent.com/jyy5206/SS_obfs/master/shadowsocksr

5)Done

当然,如果 Mr. Lean 团队能直接在源码中加入 SS+obfs 功能,那会大大方便我们小白。

善莫大焉!

jyy5206 avatar Feb 02 '20 14:02 jyy5206