From 368900632cb0eeb552d416f7ca8423c834d73a13 Mon Sep 17 00:00:00 2001 From: shasha Date: Thu, 28 Nov 2024 16:01:03 +0800 Subject: [PATCH] support function for options.localAddress --- lib/http-proxy/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js index 6513e81d8..90dcb8e24 100644 --- a/lib/http-proxy/common.js +++ b/lib/http-proxy/common.js @@ -60,7 +60,7 @@ common.setupOutgoing = function(outgoing, options, req, forward) { outgoing.agent = options.agent || false; - outgoing.localAddress = options.localAddress; + outgoing.localAddress = typeof options.localAddress === 'function' ? options.localAddress() : options.localAddress; // // Remark: If we are false and not upgrading, set the connection: close. This is the right thing to do