mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 02:51:50 +00:00
Listen only on local IP for shadowsocks
This commit is contained in:
parent
428b7ac14c
commit
5a7f85643d
5 changed files with 8 additions and 8 deletions
|
@ -1181,12 +1181,12 @@ function set_ipv6_state(disable_ipv6)
|
|||
luci.sys.call("uci -q del dhcp.lan.dhcpv6")
|
||||
luci.sys.call("uci -q del dhcp.lan.ra")
|
||||
luci.sys.call("uci -q del dhcp.lan.ra_default")
|
||||
ucic:set("shadowsocks-libev","hi","local_address","0.0.0.0")
|
||||
ucic:set("shadowsocks-libev","hi","local_address","127.0.0.1")
|
||||
else
|
||||
-- ucic:set("dhcp","lan","dhcpv6","server")
|
||||
-- ucic:set("dhcp","lan","ra","server")
|
||||
-- ucic:set("dhcp","lan","ra_default","1")
|
||||
ucic:set("shadowsocks-libev","hi","local_address","::")
|
||||
ucic:set("shadowsocks-libev","hi","local_address","::1")
|
||||
end
|
||||
ucic:save("dhcp")
|
||||
ucic:commit("dhcp")
|
||||
|
|
|
@ -39,9 +39,9 @@ set_ipv6_state() {
|
|||
uci -q delete dhcp.lan.dhcpv6
|
||||
uci -q delete dhcp.lan.ra
|
||||
uci -q delete dhcp.lan.ra_default
|
||||
uci -q set shadowsocks-libev.hi.local_address="0.0.0.0"
|
||||
uci -q set shadowsocks-libev.hi.local_address="127.0.0.1"
|
||||
else
|
||||
uci -q set shadowsocks-libev.hi.local_address="::"
|
||||
uci -q set shadowsocks-libev.hi.local_address="::1"
|
||||
fi
|
||||
uci -q commit shadowsocks-libev
|
||||
uci -q commit dhcp
|
||||
|
|
|
@ -14,7 +14,7 @@ get_ip() {
|
|||
uci -q set openmptcprouter.omr.detected_ss_ipv4=$(curl -s -4 --socks5 "${proxy}" --max-time 3 http://ip.openmptcprouter.com)
|
||||
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ]; then
|
||||
uci -q set openmptcprouter.omr.detected_public_ipv6=$(wget -6 -qO- -T 3 http://ip.openmptcprouter.com)
|
||||
# uci -q set openmptcprouter.omr.detected_ss_ipv6=$(curl -s -6 --socks5 "${proxy}" --max-time 3 http://ip.openmptcprouter.com)
|
||||
# uci -q set openmptcprouter.omr.detected_ss_ipv6=$(curl -s -6 --socks5 ":::1111" --max-time 3 http://ip.openmptcprouter.com)
|
||||
fi
|
||||
uci -q commit openmptcprouter.omr
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
|||
uci -q batch <<-EOF >/dev/null
|
||||
set shadowsocks-libev.hi$c=ss_redir
|
||||
set shadowsocks-libev.hi$c.server=sss0
|
||||
set shadowsocks-libev.hi$c.local_address="0.0.0.0"
|
||||
set shadowsocks-libev.hi$c.local_address="127.0.0.1"
|
||||
set shadowsocks-libev.hi$c.local_port=1100
|
||||
set shadowsocks-libev.hi$c.mode=tcp_and_udp
|
||||
set shadowsocks-libev.hi$c.timeout=600
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
config ss_redir hi
|
||||
option server 'sss0'
|
||||
option local_address '::'
|
||||
option local_address '::1'
|
||||
option local_port '1100'
|
||||
option mode 'tcp_and_udp'
|
||||
option timeout '600'
|
||||
|
@ -14,7 +14,7 @@ config ss_redir hi
|
|||
|
||||
config ss_redir hi2
|
||||
option server 'sss0'
|
||||
option local_address '0.0.0.0'
|
||||
option local_address '127.0.0.1'
|
||||
option local_port '1100'
|
||||
option mode 'tcp_and_udp'
|
||||
option timeout '600'
|
||||
|
|
Loading…
Reference in a new issue