fix(ss): v2ray-plugin configuration did not save

This commit is contained in:
mzz2017 committed 2022-05-25 21:34:03 +08:00
1 parent 0fa4f038b0
commit 240dbe5127
2 files changed
+36 -17

No files matched your search

+12 -9
View File
@@ -328,7 +328,7 @@
label="Mode"
label-position="on-border"
>
<b-select ref="ss_mode" value="websocket" expanded>
<b-select ref="ss_mode" v-model="ss.mode" expanded>
<option value="websocket">websocket</option>
</b-select>
</b-field>
@@ -799,6 +799,7 @@ export default {
obfs: "http",
tls: "",
path: "/",
mode: "websocket",
host: "",
password: "",
server: "",
@@ -855,14 +856,7 @@ export default {
protocol: "socks5",
name: ""
},
tabChoice: 0,
presetFlows: [
"xtls-rprx-direct",
"xtls-rprx-direct-udp443",
"xtls-rprx-splice",
"xtls-rprx-splice-udp443"
],
flowSelected: null
tabChoice: 0
}),
computed: {
filteredDataArray() {
@@ -1039,6 +1033,7 @@ export default {
break;
case "v2ray-plugin":
obj.tls = "";
obj.mode = "websocket";
break;
}
for (let i = 1; i < arr.length; i++) {
@@ -1048,11 +1043,19 @@ export default {
case "obfs":
obj.obfs = a[1];
break;
case "host":
case "obfs-host":
obj.host = a[1];
break;
case "path":
case "obfs-path":
obj.path = a[1];
break;
case "mode":
obj.mode = a[1];
break;
case "tls":
obj.tls = "tls";
}
}
}
+24 -8
View File
@@ -315,14 +315,30 @@ func ParseSip003(plugin string) Sip003 {
func (s *Sip003) String() string {
list := []string{s.Name}
if s.Opts.Obfs != "" {
list = append(list, "obfs="+s.Opts.Obfs)
}
if s.Opts.Host != "" {
list = append(list, "obfs-host="+s.Opts.Host)
}
if s.Opts.Path != "" {
list = append(list, "obfs-uri="+s.Opts.Path)
switch s.Name {
case "simple-obfs":
if s.Opts.Obfs != "" {
list = append(list, "obfs="+s.Opts.Obfs)
}
if s.Opts.Host != "" {
list = append(list, "obfs-host="+s.Opts.Host)
}
if s.Opts.Path != "" {
list = append(list, "obfs-uri="+s.Opts.Path)
}
case "v2ray-plugin":
if s.Opts.Tls != "" {
list = append(list, "tls")
}
if s.Opts.Obfs != "" {
list = append(list, "mode="+s.Opts.Obfs)
}
if s.Opts.Host != "" {
list = append(list, "host="+s.Opts.Host)
}
if s.Opts.Path != "" {
list = append(list, "path="+s.Opts.Path)
}
}
return strings.Join(list, ";")
}