Skip to content

Commit

Permalink
fix: 🐛 turn off express-http-proxy's keep alive (#1612)
Browse files Browse the repository at this point in the history
* fix: 🐛 turn off express-http-proxy's keep alive

* refactor: 🔥 remove timeout config
  • Loading branch information
stormslowly authored Sep 25, 2024
1 parent 68de8e2 commit e48ff2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/bundler-mako/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ exports.dev = async function (opts) {

app.use(
proxy(`http://127.0.0.1:${hmrPort}`, {
proxyReqOptDecorator: function (proxyReqOpts) {
// keep alive is on by default https://nodejs.org/docs/latest/api/http.html#httpglobalagent
// 禁用 keep-alive
proxyReqOpts.agent = false;
return proxyReqOpts;
},
filter: function (req, res) {
return req.method == 'GET' || req.method == 'HEAD';
},
Expand Down

0 comments on commit e48ff2a

Please sign in to comment.