Skip to content

Commit 581cac8

Browse files
committed
fix: httpclient proxy
1 parent 4cde0f1 commit 581cac8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/egg.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ class EggApplication extends EggCore {
312312
}
313313
return value;
314314
},
315+
set(_target, prop, value) {
316+
if (!realClient) {
317+
options.lookup = options.lookup ?? self.config.httpclient.lookup;
318+
realClient = new self.HttpClientNext(self, options);
319+
}
320+
realClient[prop] = value;
321+
return true;
322+
}
315323
});
316324
} else if (this.config.httpclient?.enableDNSCache) {
317325
httpClient = new DNSCacheHttpClient(this, options);

0 commit comments

Comments
 (0)