@@ -2117,6 +2117,68 @@ describe('Proxy structured producers', function () {
21172117 }
21182118 } ) ;
21192119
2120+ it ( 'filters Egern Snell shadow-tls variants' , function ( ) {
2121+ const proxies = [
2122+ {
2123+ type : 'snell' ,
2124+ name : 'Egern Snell ShadowTLS Fields' ,
2125+ server : 'snell-shadowtls.example.com' ,
2126+ port : 44046 ,
2127+ psk : 'secret' ,
2128+ version : 5 ,
2129+ 'shadow-tls-password' : 'shadow-pass' ,
2130+ 'shadow-tls-sni' : 'mask.example.com' ,
2131+ 'shadow-tls-version' : 3 ,
2132+ } ,
2133+ {
2134+ type : 'snell' ,
2135+ name : 'Egern Snell ShadowTLS Plugin' ,
2136+ server : 'snell-plugin.example.com' ,
2137+ port : 44046 ,
2138+ psk : 'secret' ,
2139+ version : 4 ,
2140+ plugin : 'shadow-tls' ,
2141+ 'plugin-opts' : {
2142+ host : 'mask.example.com' ,
2143+ password : 'shadow-pass' ,
2144+ version : 3 ,
2145+ } ,
2146+ } ,
2147+ {
2148+ type : 'snell' ,
2149+ name : 'Egern Snell Plain' ,
2150+ server : 'snell.example.com' ,
2151+ port : 44046 ,
2152+ psk : 'secret' ,
2153+ version : 5 ,
2154+ } ,
2155+ ] ;
2156+
2157+ const { result : internal , errors } = captureErrors ( ( ) =>
2158+ produceInternal ( 'Egern' , proxies ) ,
2159+ ) ;
2160+ const { result : external , errors : externalErrors } = captureErrors ( ( ) =>
2161+ loadProducedYaml ( 'Egern' , proxies ) ,
2162+ ) ;
2163+
2164+ expect ( errors ) . to . deep . equal ( [
2165+ 'Platform Egern does not support Snell shadow-tls proxy Egern Snell ShadowTLS Fields. Proxy has been filtered.' ,
2166+ 'Platform Egern does not support Snell shadow-tls proxy Egern Snell ShadowTLS Plugin. Proxy has been filtered.' ,
2167+ ] ) ;
2168+ expect ( externalErrors ) . to . deep . equal ( errors ) ;
2169+
2170+ for ( const output of [ internal , external . proxies ] ) {
2171+ expect ( output ) . to . have . length ( 1 ) ;
2172+ expectSubset ( output [ 0 ] , {
2173+ snell : {
2174+ name : 'Egern Snell Plain' ,
2175+ server : 'snell.example.com' ,
2176+ version : 5 ,
2177+ } ,
2178+ } ) ;
2179+ }
2180+ } ) ;
2181+
21202182 it ( 'emits Egern SOCKS5 over TLS and root REALITY options' , function ( ) {
21212183 const proxies = [
21222184 {
0 commit comments