@@ -1353,38 +1353,38 @@ function getConfig(userIDs, hostName) {
1353
1353
const HttpPort = new Set ( [ 80 , 8080 , 8880 , 2052 , 2086 , 2095 , 2082 ] ) ;
1354
1354
const HttpsPort = new Set ( [ 443 , 8443 , 2053 , 2096 , 2087 , 2083 ] ) ;
1355
1355
1356
- function GenSub ( ไอดีผู้ใช้_เส้นทาง , ชื่อโฮสต์ ) {
1357
- const อาร์เรย์ไอดีผู้ใช้ = ไอดีผู้ใช้_เส้นทาง . includes ( ',' ) ? ไอดีผู้ใช้_เส้นทาง . split ( ',' ) : [ ไอดีผู้ใช้_เส้นทาง ] ;
1356
+ function GenSub ( userID_path , hostname ) {
1357
+ const userIDArray = userID_path . includes ( ',' ) ? userID_path . split ( ',' ) : [ userID_path ] ;
1358
1358
const randomPath = ( ) => '/' + Math . random ( ) . toString ( 36 ) . substring ( 2 , 15 ) + '?ed=2048' ;
1359
- const ส่วนUrlทั่วไปHttp = `?encryption=none&security=none&fp=random&type=ws&host=${ ชื่อโฮสต์ } &path=${ encodeURIComponent ( randomPath ( ) ) } #` ;
1360
- const ส่วนUrlทั่วไปHttps = `?encryption=none&security=tls&sni=${ ชื่อโฮสต์ } &fp=random&type=ws&host=${ ชื่อโฮสต์ } &path=%2F%3Fed%3D2048#` ;
1361
-
1362
- const ผลลัพธ์ = อาร์เรย์ไอดีผู้ใช้ . flatMap ( ( ไอดีผู้ใช้ ) => {
1363
- const PartHttp = Array . from ( HttpPort ) . flatMap ( ( พอร์ต ) => {
1364
- if ( ! ชื่อโฮสต์ . includes ( 'pages.dev' ) ) {
1365
- const ส่วนUrl = `${ ชื่อโฮสต์ } -HTTP-${ พอร์ต } ` ;
1366
- const protocolหลักHttp = atob ( pt ) + '://' + ไอดีผู้ใช้ + atob ( at ) + ชื่อโฮสต์ + ':' + พอร์ต + ส่วนUrlทั่วไปHttp + ส่วนUrl ;
1359
+ const commonUrlPartHttp = `?encryption=none&security=none&fp=random&type=ws&host=${ hostname } &path=${ encodeURIComponent ( randomPath ( ) ) } #` ;
1360
+ const commonUrlPartHttps = `?encryption=none&security=tls&sni=${ hostname } &fp=random&type=ws&host=${ hostname } &path=%2F%3Fed%3D2048#` ;
1361
+
1362
+ const result = userIDArray . flatMap ( ( userID ) => {
1363
+ const PartHttp = Array . from ( HttpPort ) . flatMap ( ( port ) => {
1364
+ if ( ! hostname . includes ( 'pages.dev' ) ) {
1365
+ const urlPart = `${ hostname } -HTTP-${ port } ` ;
1366
+ const mainProtocolHttp = atob ( pt ) + '://' + userID + atob ( at ) + hostname + ':' + port + commonUrlPartHttp + urlPart ;
1367
1367
return proxyIPs . flatMap ( ( proxyIP ) => {
1368
- const protocolรองHttp = atob ( pt ) + '://' + ไอดีผู้ใช้ + atob ( at ) + proxyIP + ':' + proxyPort + ส่วนUrlทั่วไปHttp + ส่วนUrl + '-' + proxyIP + '-' + atob ( ed ) ;
1369
- return [ protocolหลักHttp , protocolรองHttp ] ;
1368
+ const secondaryProtocolHttp = atob ( pt ) + '://' + userID + atob ( at ) + proxyIP . split ( ':' ) [ 0 ] + ':' + proxyPort + commonUrlPartHttp + urlPart + '-' + proxyIP + '-' + atob ( ed ) ;
1369
+ return [ mainProtocolHttp , secondaryProtocolHttp ] ;
1370
1370
} ) ;
1371
1371
}
1372
1372
return [ ] ;
1373
1373
} ) ;
1374
1374
1375
- const PartHttps = Array . from ( HttpsPort ) . flatMap ( ( พอร์ต ) => {
1376
- const ส่วนUrl = `${ ชื่อโฮสต์ } -HTTPS-${ พอร์ต } ` ;
1377
- const protocolหลักHttps = atob ( pt ) + '://' + ไอดีผู้ใช้ + atob ( at ) + ชื่อโฮสต์ + ':' + พอร์ต + ส่วนUrlทั่วไปHttps + ส่วนUrl ;
1375
+ const PartHttps = Array . from ( HttpsPort ) . flatMap ( ( port ) => {
1376
+ const urlPart = `${ hostname } -HTTPS-${ port } ` ;
1377
+ const mainProtocolHttps = atob ( pt ) + '://' + userID + atob ( at ) + hostname + ':' + port + commonUrlPartHttps + urlPart ;
1378
1378
return proxyIPs . flatMap ( ( proxyIP ) => {
1379
- const protocolรองHttps = atob ( pt ) + '://' + ไอดีผู้ใช้ + atob ( at ) + proxyIP + ':' + proxyPort + ส่วนUrlทั่วไปHttps + ส่วนUrl + '-' + proxyIP + '-' + atob ( ed ) ;
1380
- return [ protocolหลักHttps , protocolรองHttps ] ;
1379
+ const secondaryProtocolHttps = atob ( pt ) + '://' + userID + atob ( at ) + proxyIP . split ( ':' ) [ 0 ] + ':' + proxyPort + commonUrlPartHttps + urlPart + '-' + proxyIP + '-' + atob ( ed ) ;
1380
+ return [ mainProtocolHttps , secondaryProtocolHttps ] ;
1381
1381
} ) ;
1382
1382
} ) ;
1383
1383
1384
1384
return [ ...PartHttp , ...PartHttps ] ;
1385
1385
} ) ;
1386
1386
1387
- return ผลลัพธ์ . join ( '\n' ) ;
1387
+ return result . join ( '\n' ) ;
1388
1388
}
1389
1389
1390
1390
const hostnames = [
0 commit comments