@@ -57,7 +57,10 @@ public class ShadowsocksFmt : BaseFmt
5757 {
5858 pluginArgs += "mode=websocket;" ;
5959 pluginArgs += $ "host={ item . RequestHost } ;";
60- pluginArgs += $ "path={ item . Path } ;";
60+ // https://github.com/shadowsocks/v2ray-plugin/blob/e9af1cdd2549d528deb20a4ab8d61c5fbe51f306/args.go#L172
61+ // Equal signs and commas [and backslashes] must be escaped with a backslash.
62+ var path = item . Path . Replace ( "\\ " , "\\ \\ " ) . Replace ( "=" , "\\ =" ) . Replace ( "," , "\\ ," ) ;
63+ pluginArgs += $ "path={ path } ;";
6164 }
6265 else if ( item . Network == nameof ( ETransport . quic ) )
6366 {
@@ -75,8 +78,6 @@ public class ShadowsocksFmt : BaseFmt
7578
7679 var base64Content = cert . Replace ( beginMarker , "" ) . Replace ( endMarker , "" ) . Trim ( ) ;
7780
78- // https://github.com/shadowsocks/v2ray-plugin/blob/e9af1cdd2549d528deb20a4ab8d61c5fbe51f306/args.go#L172
79- // Equal signs and commas [and backslashes] must be escaped with a backslash.
8081 base64Content = base64Content . Replace ( "=" , "\\ =" ) ;
8182
8283 pluginArgs += $ "certRaw={ base64Content } ;";
@@ -85,6 +86,7 @@ public class ShadowsocksFmt : BaseFmt
8586 if ( pluginArgs . Length > 0 )
8687 {
8788 plugin = "v2ray-plugin" ;
89+ pluginArgs += "mux=0;" ;
8890 }
8991 }
9092
@@ -222,6 +224,7 @@ public class ShadowsocksFmt : BaseFmt
222224 var path = pluginParts . FirstOrDefault ( t => t . StartsWith ( "path=" ) ) ;
223225 var hasTls = pluginParts . Any ( t => t == "tls" ) ;
224226 var certRaw = pluginParts . FirstOrDefault ( t => t . StartsWith ( "certRaw=" ) ) ;
227+ var mux = pluginParts . FirstOrDefault ( t => t . StartsWith ( "mux=" ) ) ;
225228
226229 var modeValue = mode . Replace ( "mode=" , "" ) ;
227230 if ( modeValue == "websocket" )
@@ -234,7 +237,9 @@ public class ShadowsocksFmt : BaseFmt
234237 }
235238 if ( ! path . IsNullOrEmpty ( ) )
236239 {
237- item . Path = path . Replace ( "path=" , "" ) ;
240+ var pathValue = path . Replace ( "path=" , "" ) ;
241+ pathValue = pathValue . Replace ( "\\ =" , "=" ) . Replace ( "\\ ," , "," ) . Replace ( "\\ \\ " , "\\ " ) ;
242+ item . Path = pathValue ;
238243 }
239244 }
240245 else if ( modeValue == "quic" )
@@ -258,6 +263,16 @@ public class ShadowsocksFmt : BaseFmt
258263 item . Cert = certPem ;
259264 }
260265 }
266+
267+ if ( ! mux . IsNullOrEmpty ( ) )
268+ {
269+ var muxValue = mux . Replace ( "mux=" , "" ) ;
270+ var muxCount = muxValue . ToInt ( ) ;
271+ if ( muxCount > 0 )
272+ {
273+ return null ;
274+ }
275+ }
261276 }
262277 }
263278
0 commit comments