Merge pull request #13916 from meteor/feature/http-proxy-3

Replace http-proxy with http-proxy-3
This commit is contained in:
Italo José
2026-04-06 12:46:42 -03:00
committed by GitHub
8 changed files with 33 additions and 13 deletions

View File

@@ -101,10 +101,10 @@ Copyright 2011 Marcel Laverdet
----------
http-proxy: https://github.com/nodejitsu/node-http-proxy
http-proxy-3: https://github.com/sagemathinc/http-proxy-3
----------
Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires
Copyright (c) 2010-2025 William Stein, Charlie Robbins, Jarrett Cruger & the Contributors.
----------
@@ -803,7 +803,7 @@ Copyright 20092014 Kristopher Michael Kowal. All rights reserved.
querystring-es3: https://github.com/mike-spainhower/querystring
----------
Copyright 2012 Irakli Gozalishvili. All rights reserved.
Copyright 2012 Irakli Gozalishvili. All rights reserved.
----------
@@ -1073,7 +1073,7 @@ Copyright (C) 2012-2014 by Jun Woong and Tim Oxley.
adm-zip: https://github.com/cthackers/adm-zip
----------
Copyright (c) 2012 Another-D-Mention Software and other contributors,
Copyright (c) 2012 Another-D-Mention Software and other contributors,
http://www.another-d-mention.ro/

2
meteor
View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
BUNDLE_VERSION=24.14.0.4
BUNDLE_VERSION=24.14.0.5
# OS Check. Put here because here is where we download the precompiled
# bundles that are arch specific.

View File

@@ -39,7 +39,7 @@ var packageJson = {
"source-map": "0.7.3",
chalk: "4.1.2",
sqlite3: "5.1.6",
"http-proxy": "1.18.1",
"http-proxy-3": "1.22.0",
"is-reachable": "3.1.0",
"wordwrap": "1.0.0",
"moment": "2.29.1",

View File

@@ -166,13 +166,26 @@ testAsyncMulti(
process.env.UNIX_SOCKET_PATH = testSocketFile;
const result = await main({ httpServer });
test.equal(result, "DAEMON");
const currentGid = userInfo({ encoding: "utf8" })?.gid;
test.equal((await getChownInfo(testSocketFile))?.gid, currentGid);
return closeServer({ httpServer, server });
},
async (test) => {
const isLinux = platform() === 'linux';
const isTravis = Boolean(process.env.TRAVIS);
if (isLinux && !isTravis) {
/*
* Local Linux developers usually run Meteor as an unprivileged user.
* Changing the socket file's group to "root" would require elevated
* permissions, so we skip this assertion outside CI to avoid forcing
* sudo usage. The behavior is still verified on macOS and in CI.
*/
test.ok();
return;
}
// use UNIX_SOCKET_PATH and UNIX_SOCKET_GROUP
const groupToUse = getWritableGroupName();

View File

@@ -18,6 +18,7 @@ import {
} from './socket_file.js';
import cluster from 'cluster';
import { execSync } from 'child_process';
import { onMessage } from 'meteor/inter-process-messaging';
var SHORT_SOCKET_TIMEOUT = 5 * 1000;
var LONG_SOCKET_TIMEOUT = 120 * 1000;
@@ -794,8 +795,6 @@ WebAppInternals.parsePort = port => {
return parsedPort;
};
import { onMessage } from 'meteor/inter-process-messaging';
onMessage('webapp-pause-client', async ({ arch }) => {
await WebAppInternals.pauseClient(arch);
});
@@ -1448,7 +1447,15 @@ async function runWebAppServer() {
if (unixSocketGroupInfo === null) {
throw new Error('Invalid UNIX_SOCKET_GROUP name specified');
}
chownSync(unixSocketPath, userInfo().uid, unixSocketGroupInfo.gid);
try {
chownSync(unixSocketPath, userInfo().uid, unixSocketGroupInfo.gid);
} catch (error) {
if (error.code === 'EPERM' || error.code === 'EACCES') {
console.error(`Skipping UNIX_SOCKET_GROUP change for "${unixSocketGroup}" because current user lacks permission.`);
} else {
throw error;
}
}
}
registerSocketFileCleanup(unixSocketPath);

View File

@@ -426,7 +426,7 @@ Tinytest.addAsync("webapp - parse url queries", async function (test) {
];
let i = 0;
for await (const queriesTestCase of queriesTestCases) {
const resp = await asyncGet(`${Meteor.absoluteUrl()}/queries?${queriesTestCase}`);
const resp = await asyncGet(Meteor.absoluteUrl(`/queries?${queriesTestCase}`));
const queryParsed = JSON.parse(resp.content);
test.equal(queryParsed, queryResults[i]);
i++;

View File

@@ -44,7 +44,7 @@ var packageJson = {
// TODO: maybe replace with https://www.npmjs.com/package/better-sqlite3
sqlite3: "5.1.7",
inquirer: "8.2.6",
"http-proxy": "1.18.1",
"http-proxy-3": "1.22.0",
"is-reachable": "3.1.0",
"wordwrap": "1.0.0",
"moment": "2.30.1",

View File

@@ -37,7 +37,7 @@ Object.assign(Proxy.prototype, {
var http = require('http');
var net = require('net');
var httpProxy = require('http-proxy');
var httpProxy = require('http-proxy-3');
self.proxy = httpProxy.createProxyServer({
// agent is required to handle keep-alive, and http-proxy 1.0 is a little