com.jimuwd.xian.registry-proxy 1.0.113 → 1.0.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -417,13 +417,14 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
|
|
|
417
417
|
serverIpv4.on('connection', connectionHandler);
|
|
418
418
|
// 为了代理服务器的健壮性,先启动ipv6监听,然后再在其回调函数中启动ipv4监听
|
|
419
419
|
serverIpv6.listen(port, '::', () => {
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
420
|
+
const addressInfo = serverIpv6.address();
|
|
421
|
+
// 回写上层局部变量
|
|
422
|
+
proxyPort = addressInfo.port;
|
|
423
|
+
logger.info(`前面已经监听了ipv6端口 ${addressInfo.address} ${addressInfo.port},追加监听Ipv4同端口号 0.0.0.0:${addressInfo.port}`);
|
|
424
|
+
serverIpv4.listen(addressInfo.port, '0.0.0.0', () => {
|
|
424
425
|
const portFile = join(process.env.PROJECT_ROOT || process.cwd(), '.registry-proxy-port');
|
|
425
|
-
writeFile(portFile,
|
|
426
|
-
logger.info(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${
|
|
426
|
+
writeFile(portFile, addressInfo.port.toString()).catch(e => logger.error(`Failed to write port file: ${portFile}`, e));
|
|
427
|
+
logger.info(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${addressInfo.port}${basePathPrefixedWithSlash === '/' ? '' : basePathPrefixedWithSlash}`);
|
|
427
428
|
resolve({ serverIpv6, serverIpv4, });
|
|
428
429
|
});
|
|
429
430
|
});
|