diff --git a/gui/src/components/modalServer.vue b/gui/src/components/modalServer.vue index 2e95efbe..529738fb 100644 --- a/gui/src/components/modalServer.vue +++ b/gui/src/components/modalServer.vue @@ -328,7 +328,7 @@ label="Mode" label-position="on-border" > - + @@ -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"; } } } diff --git a/service/core/serverObj/shadowsocks.go b/service/core/serverObj/shadowsocks.go index 2d2fd321..9add08ab 100644 --- a/service/core/serverObj/shadowsocks.go +++ b/service/core/serverObj/shadowsocks.go @@ -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, ";") }