File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/modules/subscription-template/generators Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,11 @@ import { IFormattedHost } from './interfaces/formatted-hosts.interface';
25
25
26
26
@Injectable ( )
27
27
export class FormatHostsService {
28
- constructor ( private readonly queryBus : QueryBus ) { }
28
+ private readonly nanoid : ReturnType < typeof customAlphabet > ;
29
+
30
+ constructor ( private readonly queryBus : QueryBus ) {
31
+ this . nanoid = customAlphabet ( '0123456789abcdefghjkmnopqrstuvwxyz' , 10 ) ;
32
+ }
29
33
30
34
public async generateFormattedHosts (
31
35
config : XRayConfig ,
@@ -184,7 +188,6 @@ export class FormatHostsService {
184
188
const realitySettings = inbound . streamSettings ?. realitySettings ;
185
189
sniFromConfig = realitySettings ?. serverNames ?. [ 0 ] ;
186
190
fingerprintFromConfig = realitySettings ?. fingerprint ;
187
- // publicKeyFromConfig = realitySettings?.publicKey || realitySettings?.password;
188
191
189
192
publicKeyFromConfig = publicKeyMap . get ( inbound . tag ) ;
190
193
@@ -242,9 +245,7 @@ export class FormatHostsService {
242
245
}
243
246
244
247
if ( sni . includes ( '*.' ) ) {
245
- const nanoid = customAlphabet ( '0123456789abcdefghjkmnopqrstuvwxyz' , 10 ) ;
246
-
247
- sni = sni . replace ( '*' , nanoid ( ) ) ;
248
+ sni = sni . replace ( '*' , this . nanoid ( ) ) ;
248
249
}
249
250
250
251
// Fingerprint
You can’t perform that action at this time.
0 commit comments