diff --git a/gui/src/components/modalCustomPorts.vue b/gui/src/components/modalCustomPorts.vue
index b9d3dc56..15ee8b3f 100644
--- a/gui/src/components/modalCustomPorts.vue
+++ b/gui/src/components/modalCustomPorts.vue
@@ -44,6 +44,18 @@
required
>
+
+
+
0 {
if err := service.CheckGrpcSupported(); err != nil {
@@ -1448,7 +1451,7 @@ func (t *Template) setVlessGrpcRouting() {
for i := range t.Routing.Rules {
var bHasRule bool
for _, tag := range t.Routing.Rules[i].InboundTag {
- if tag == "rule" {
+ if tag == "rule-http" {
bHasRule = true
}
}
diff --git a/service/db/configure/configure.go b/service/db/configure/configure.go
index 6cb5fa2c..6c9e29fe 100644
--- a/service/db/configure/configure.go
+++ b/service/db/configure/configure.go
@@ -33,10 +33,11 @@ func New() *Configure {
Setting: NewSetting(),
Accounts: map[string]string{},
Ports: Ports{
- Socks5: 20170,
- Http: 20171,
- HttpWithPac: 20172,
- VlessGrpc: 0,
+ Socks5: 20170,
+ Socks5WithPac: 0,
+ Http: 20171,
+ HttpWithPac: 20172,
+ VlessGrpc: 0,
},
InternalDnsList: nil,
ExternalDnsList: nil,
@@ -260,6 +261,7 @@ func GetPortsNotNil() *Ports {
p = new(Ports)
p.Socks5 = 20170
p.Http = 20171
+ p.Socks5WithPac = 0
p.HttpWithPac = 20172
p.VlessGrpc = 0
}
diff --git a/service/db/configure/ports.go b/service/db/configure/ports.go
index 266e13e4..21354fb5 100644
--- a/service/db/configure/ports.go
+++ b/service/db/configure/ports.go
@@ -1,8 +1,9 @@
package configure
type Ports struct {
- Socks5 int `json:"socks5"`
- Http int `json:"http"`
- HttpWithPac int `json:"httpWithPac"`
- VlessGrpc int `json:"vlessGrpc"`
+ Socks5 int `json:"socks5"`
+ Http int `json:"http"`
+ Socks5WithPac int `json:"socks5WithPac"`
+ HttpWithPac int `json:"httpWithPac"`
+ VlessGrpc int `json:"vlessGrpc"`
}
diff --git a/service/server/service/ports.go b/service/server/service/ports.go
index 45381bb1..0020ff87 100644
--- a/service/server/service/ports.go
+++ b/service/server/service/ports.go
@@ -24,6 +24,10 @@ func SetPorts(ports *configure.Ports) (err error) {
set[ports.Http] = struct{}{}
cnt++
}
+ if ports.Socks5WithPac != 0 {
+ set[ports.Socks5WithPac] = struct{}{}
+ cnt++
+ }
if ports.HttpWithPac != 0 {
set[ports.HttpWithPac] = struct{}{}
cnt++
@@ -48,6 +52,12 @@ func SetPorts(ports *configure.Ports) (err error) {
detectSyntax = append(detectSyntax, strconv.Itoa(origin.Http)+":tcp")
}
}
+ if ports.Socks5WithPac != origin.Socks5WithPac {
+ origin.Socks5WithPac = ports.Socks5WithPac
+ if origin.Socks5WithPac != 0 {
+ detectSyntax = append(detectSyntax, strconv.Itoa(origin.Socks5WithPac)+":tcp,udp")
+ }
+ }
if ports.HttpWithPac != origin.HttpWithPac {
origin.HttpWithPac = ports.HttpWithPac
if origin.HttpWithPac != 0 {