mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add keep alive support to Shadowsocks-Rust init and interface
This commit is contained in:
parent
ef3eaf6ed1
commit
43107110a5
4 changed files with 19 additions and 2 deletions
|
@ -28,6 +28,7 @@ var names_options_common = [
|
|||
'mode',
|
||||
'mtu',
|
||||
'timeout',
|
||||
'keep_alive',
|
||||
'user',
|
||||
'mptcp',
|
||||
];
|
||||
|
@ -157,6 +158,8 @@ return L.Class.extend({
|
|||
o.datatype = 'uinteger';
|
||||
o = s.taboption(tab, form.Value, 'timeout', _('Timeout (sec)'));
|
||||
o.datatype = 'uinteger';
|
||||
o = s.taboption(tab, form.Value, 'keep_alive', _('Keep Alive (sec)'));
|
||||
o.datatype = 'uinteger';
|
||||
s.taboption(tab, form.Value, 'user', _('Run as'));
|
||||
|
||||
s.taboption(tab, form.Flag, 'verbose', _('Verbose'));
|
||||
|
|
|
@ -116,6 +116,15 @@ if [ "$(uci -q get shadowsocks-libev.sss1)" = "" ]; then
|
|||
commit shadowsocks-libev
|
||||
EOF
|
||||
fi
|
||||
if [ -z "$(uci -q get shadowsocks-rust.hi1.keep_alive)" ]; then
|
||||
uci -q batch <<-EOF > /dev/null
|
||||
set shadowsocks-rust.hi1.keep_alive=15
|
||||
set shadowsocks-rust.hi1.no_delay=1
|
||||
set shadowsocks-rust.hi2.keep_alive=15
|
||||
set shadowsocks-rust.hi2.no_delay=1
|
||||
commit shadowsocks-rust
|
||||
EOF
|
||||
fi
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
|
|
|
@ -4,13 +4,14 @@ config ss_redir hi1
|
|||
option local_port '1100'
|
||||
option mode 'tcp_and_udp'
|
||||
option timeout '1000'
|
||||
option keep_alive '15'
|
||||
option fast_open 0
|
||||
option verbose 0
|
||||
option syslog 1
|
||||
option reuse_port 0
|
||||
option mptcp 1
|
||||
option ipv6_first 1
|
||||
option no_delay 0
|
||||
option no_delay 1
|
||||
|
||||
config ss_redir hi2
|
||||
option server 'sss1'
|
||||
|
@ -18,13 +19,14 @@ config ss_redir hi2
|
|||
option local_port '1101'
|
||||
option mode 'tcp_and_udp'
|
||||
option timeout '1000'
|
||||
option keep_alive '15'
|
||||
option fast_open 0
|
||||
option verbose 0
|
||||
option syslog 1
|
||||
option reuse_port 0
|
||||
option mptcp 1
|
||||
option ipv6_first 1
|
||||
option no_delay 0
|
||||
option no_delay 1
|
||||
|
||||
config ss_rules 'ss_rules'
|
||||
option disabled 0
|
||||
|
@ -63,6 +65,7 @@ config ss_local 'tracker_sss0'
|
|||
option local_port '1111'
|
||||
option mode 'tcp_and_udp'
|
||||
option timeout '600'
|
||||
option keep_alive '15'
|
||||
option fast_open '0'
|
||||
option syslog '0'
|
||||
option reuse_port '1'
|
||||
|
|
|
@ -87,6 +87,7 @@ ss_xxx() {
|
|||
[ -z "$mode" ] || json_add_string mode "$mode"
|
||||
[ -z "$mtu" ] || json_add_int mtu "$mtu"
|
||||
[ -z "$timeout" ] || json_add_int timeout "$timeout"
|
||||
[ -z "$keep_alive" ] || json_add_int keep_alive "$keep_alive"
|
||||
[ -z "$user" ] || json_add_string user "$user"
|
||||
[ -z "$acl" ] || json_add_string acl "$acl"
|
||||
json_dump -i >"$confjson"
|
||||
|
@ -369,6 +370,7 @@ validate_common_options_() {
|
|||
'mode:or("tcp_only", "udp_only", "tcp_and_udp"):tcp_only' \
|
||||
'mtu:uinteger' \
|
||||
'timeout:uinteger' \
|
||||
'keep_alive:uinteger' \
|
||||
'user:string'
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue