com.jimuwd.xian.registry-proxy 1.0.107 → 1.0.108

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 +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -155,7 +155,7 @@ async function fetchFromRegistry(registry, targetUrl, reqFromDownstreamClient, l
155
155
  }
156
156
  }
157
157
  async function writeResponseToDownstreamClient(registryInfo, targetUrl, resToDownstreamClient, upstreamResponse, reqFromDownstreamClient, proxyInfo, proxyPort, registryInfos) {
158
- logger.info(`Writing upstream registry server ${registryInfo.normalizedRegistryUrl}'s 2xx ok response to downstream ${reqFromDownstreamClient.headers.from} ${reqFromDownstreamClient.headers["user-agent"]}`);
158
+ logger.info(`Writing upstream registry server ${registryInfo.normalizedRegistryUrl}'s ${upstreamResponse.status}${upstreamResponse.statusText ? (' "' + upstreamResponse.statusText + '"') : ''} response to downstream client.`);
159
159
  if (!upstreamResponse.ok)
160
160
  throw new Error("Only 2xx upstream response is supported");
161
161
  try {
@@ -393,11 +393,12 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
393
393
  reject(err);
394
394
  });
395
395
  server.on('connection', (socket) => {
396
- logger.debug("Server on connection");
396
+ logger.info("Server on connection");
397
397
  socket.setTimeout(60000);
398
398
  socket.setKeepAlive(true, 30000);
399
399
  });
400
- server.listen(port, () => {
400
+ // ipv4和ipv6双栈支持
401
+ server.listen(port, '::', () => {
401
402
  const address = server.address();
402
403
  proxyPort = address.port;
403
404
  const portFile = join(process.env.PROJECT_ROOT || process.cwd(), '.registry-proxy-port');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.jimuwd.xian.registry-proxy",
3
- "version": "1.0.107",
3
+ "version": "1.0.108",
4
4
  "description": "A lightweight npm registry proxy with fallback support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",