Skip to content

Commit

Permalink
add sniffing routeOnly option
Browse files Browse the repository at this point in the history
  • Loading branch information
moolex committed Mar 31, 2024
1 parent 84978d6 commit 567db0d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
15 changes: 10 additions & 5 deletions public/po/templates/v2ray.pot
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ msgstr ""
msgid "All connections share this level"
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:387
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:392
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:390
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:395
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:398
msgid "Allocate"
msgstr ""

Expand Down Expand Up @@ -212,7 +212,7 @@ msgstr ""
msgid "Collecting data..."
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:395
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:398
#: package/htdocs/luci-static/resources/view/v2ray/outbound.js:540
msgid "Concurrency"
msgstr ""
Expand Down Expand Up @@ -888,7 +888,7 @@ msgstr ""
msgid "Redirect port"
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:392
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:395
msgid "Refresh"
msgstr ""

Expand Down Expand Up @@ -933,6 +933,10 @@ msgstr ""
msgid "Reverse"
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:388
msgid "RouteOnly"
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/routing.js:21
#: package/luasrc/controller/v2ray.lua:23
#: package/root/usr/share/luci/menu.d/luci-app-v2ray.json:50
Expand Down Expand Up @@ -1024,6 +1028,7 @@ msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:381
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:383
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:388
msgid "Sniffing"
msgstr ""

Expand Down Expand Up @@ -1062,7 +1067,7 @@ msgstr ""
msgid "Stats user uplink"
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:387
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:390
msgid "Strategy"
msgstr ""

Expand Down
15 changes: 10 additions & 5 deletions public/po/zh_Hans/v2ray.po
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ msgstr "别名"
msgid "All connections share this level"
msgstr "所有连接都会使用这个用户等级"

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:387
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:392
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:390
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:395
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:398
msgid "Allocate"
msgstr "端口分配"

Expand Down Expand Up @@ -212,7 +212,7 @@ msgstr "用户邮箱地址"
msgid "Collecting data..."
msgstr "正在收集数据..."

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:395
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:398
#: package/htdocs/luci-static/resources/view/v2ray/outbound.js:540
msgid "Concurrency"
msgstr "随机端口数量"
Expand Down Expand Up @@ -888,7 +888,7 @@ msgstr "转发 UDP 流量到 V2Ray。"
msgid "Redirect port"
msgstr "转发端口"

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:392
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:395
msgid "Refresh"
msgstr "随机端口刷新间隔"

Expand Down Expand Up @@ -933,6 +933,10 @@ msgstr "响应类型"
msgid "Reverse"
msgstr "反向代理"

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:388
msgid "RouteOnly"
msgstr ""

#: package/htdocs/luci-static/resources/view/v2ray/routing.js:21
#: package/luasrc/controller/v2ray.lua:23
#: package/root/usr/share/luci/menu.d/luci-app-v2ray.json:50
Expand Down Expand Up @@ -1024,6 +1028,7 @@ msgstr "回退时跳过"

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:381
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:383
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:388
msgid "Sniffing"
msgstr "流量探测"

Expand Down Expand Up @@ -1062,7 +1067,7 @@ msgstr "用户上行流量统计"
msgid "Stats user uplink"
msgstr "用户下行流量统计"

#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:387
#: package/htdocs/luci-static/resources/view/v2ray/inbound.js:390
msgid "Strategy"
msgstr "端口分配策略"

Expand Down
5 changes: 4 additions & 1 deletion public/root/etc/init.d/v2ray
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ inbound_section_validate() {
'ss_sockopt_tproxy:or("redirect", "tproxy", "off")' \
'tag:string' \
'sniffing_enabled:bool:0' \
'sniffing_dest_override:list(or("http", "tls"))' \
'sniffing_dest_override:list(or("http", "tls", "quic"))' \
'sniffing_route_only:bool:0' \
'allocate_strategy:or("always", "random")' \
'allocate_refresh:uinteger' \
'allocate_concurrency:uinteger'
Expand Down Expand Up @@ -1498,6 +1499,8 @@ add_inbound_setting() {
json_close_array # destOverride
fi

json_add_boolean "routeOnly" "$sniffing_route_only"

json_close_object # sniffing

if [ -n "$allocate_strategy" ] ; then
Expand Down
9 changes: 9 additions & 0 deletions src/view/v2ray/inbound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,15 @@ return L.view.extend<string[]>({
o.modalonly = true;
o.value("http");
o.value("tls");
o.value("quic");

o = s.taboption(
"other",
form.Flag,
"sniffing_route_only",
"%s - %s".format(_("Sniffing"), _("RouteOnly"))
);
o.modalonly = true;

o = s.taboption(
"other",
Expand Down

0 comments on commit 567db0d

Please sign in to comment.