mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
feat: support setting sniffing routeOnly
This commit is contained in:
1 parent
36bb7b6f86
commit
22d65d6718
4 files changed
+15
-5
No files matched your search
@@ -69,7 +69,7 @@
|
||||
</b-select>
|
||||
|
||||
<template v-if="transparentType == 'tproxy'">
|
||||
<b-button type="is-primary" style="
|
||||
<b-button style="
|
||||
margin-left: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
@@ -187,13 +187,15 @@
|
||||
<option value="http,tls,quic">Http + TLS + Quic</option>
|
||||
</b-select>
|
||||
<template v-if="inboundSniffing != 'disable'">
|
||||
<b-button type="is-primary" style="
|
||||
<b-button style="
|
||||
margin-left: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-radius: 0px;
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
" outlined @click="handleClickDomainsExcluded">{{ $t("operations.domainsExcluded") }}
|
||||
</b-button>
|
||||
<b-checkbox-button v-model="routeOnly" :native-value="true" style="position: relative; left: -1px;">
|
||||
RouteOnly
|
||||
</b-checkbox-button>
|
||||
</template>
|
||||
</b-field>
|
||||
|
||||
@@ -302,6 +304,7 @@ export default {
|
||||
dnsForceMode: false,
|
||||
dnsforward: "no",
|
||||
antipollution: "none",
|
||||
routeOnly: false,
|
||||
specialMode: "none",
|
||||
pacAutoUpdateMode: "none",
|
||||
pacAutoUpdateIntervalHour: 0,
|
||||
@@ -393,6 +396,7 @@ export default {
|
||||
transparentType: this.transparentType,
|
||||
ipforward: this.ipforward,
|
||||
portSharing: this.portSharing,
|
||||
routeOnly: this.routeOnly,
|
||||
dnsforward: this.antipollution === "dnsforward" ? "yes" : "no", //版本兼容
|
||||
antipollution: this.antipollution,
|
||||
specialMode: this.specialMode,
|
||||
@@ -470,7 +474,7 @@ export default {
|
||||
canCancel: true,
|
||||
});
|
||||
},
|
||||
handleClickTproxyWhiteIpGroups(){
|
||||
handleClickTproxyWhiteIpGroups() {
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: modalTproxyWhiteIpGroups,
|
||||
|
||||
@@ -56,6 +56,7 @@ type Sniffing struct {
|
||||
DestOverride []string `json:"destOverride,omitempty"`
|
||||
MetadataOnly bool `json:"metadataOnly"`
|
||||
DomainsExcluded []string `json:"domainsExcluded"`
|
||||
RouteOnly bool `json:"routeOnly"`
|
||||
}
|
||||
type Inbound struct {
|
||||
Port int `json:"port"`
|
||||
|
||||
@@ -668,6 +668,7 @@ func parseRoutingA(t *Template, routingInboundTags []string) error {
|
||||
Sniffing: coreObj.Sniffing{
|
||||
Enabled: false,
|
||||
DestOverride: []string{"http", "tls"},
|
||||
RouteOnly: false,
|
||||
},
|
||||
}
|
||||
if sniffing := proto.NamedParams["sniffing"]; len(sniffing) > 0 {
|
||||
@@ -1117,6 +1118,7 @@ func (t *Template) setInbound(setting *configure.Setting) error {
|
||||
|
||||
// 设置域名嗅探
|
||||
if setting.InboundSniffing != configure.InboundSniffingDisable && setting.InboundSniffing != "" {
|
||||
enableSniffingRouteOnly := configure.GetSettingNotNil().RouteOnly
|
||||
domainsExcludedText := configure.GetDomainsExcluded()
|
||||
for i := len(t.Inbounds) - 1; i >= 0; i-- {
|
||||
if setting.InboundSniffing == configure.InboundSniffingHttpTLS {
|
||||
@@ -1126,7 +1128,9 @@ func (t *Template) setInbound(setting *configure.Setting) error {
|
||||
}
|
||||
t.Inbounds[i].Sniffing.DomainsExcluded = strings.Split(domainsExcludedText, "\n")
|
||||
t.Inbounds[i].Sniffing.Enabled = true
|
||||
t.Inbounds[i].Sniffing.RouteOnly = enableSniffingRouteOnly
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ type Setting struct {
|
||||
InboundSniffing InboundSniffing `json:"inboundSniffing"`
|
||||
Transparent TransparentMode `json:"transparent"`
|
||||
IpForward bool `json:"ipforward"`
|
||||
RouteOnly bool `json:"routeOnly"`
|
||||
PortSharing bool `json:"portSharing"`
|
||||
SpecialMode SpecialMode `json:"specialMode"`
|
||||
TransparentType TransparentType `json:"transparentType"`
|
||||
|
||||
Reference in new issue
Block a user