com.jimuwd.xian.registry-proxy 1.0.128 → 1.0.129

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -409,12 +409,13 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
409
409
  server.on('connection', connectionHandler);
410
410
  // 为了代理服务器的安全性,暂时只监听本机ipv6地址【::1】,不能对本机之外暴露本代理服务地址避免造成安全隐患
411
411
  // 注意:截止目前yarn客户端如果通过localhost:<port>来访问本服务,可能会报错ECONNREFUSED错误码,原因是yarn客户端环境解析“localhost”至多个地址,它会尝试轮询每个地址。
412
- const listenOptions = { port, host: '::1', ipv6Only: true };
412
+ const ipv6OnlyHost = '::1';
413
+ const listenOptions = { port, host: ipv6OnlyHost, ipv6Only: true };
413
414
  server.listen(listenOptions, async () => {
414
415
  const addressInfo = server.address();
415
416
  port = addressInfo.port; // 回写上层局部变量
416
417
  await writePortFile(port);
417
- logger.info(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${addressInfo.port}${basePathPrefixedWithSlash === '/' ? '' : basePathPrefixedWithSlash}`);
418
+ logger.info(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://${ipv6OnlyHost}:${port}${basePathPrefixedWithSlash === '/' ? '' : basePathPrefixedWithSlash}`);
418
419
  resolve(server);
419
420
  });
420
421
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.jimuwd.xian.registry-proxy",
3
- "version": "1.0.128",
3
+ "version": "1.0.129",
4
4
  "description": "A lightweight npm registry proxy with fallback support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",