Skip to content

Commit

Permalink
feat: log proxy error content (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed May 27, 2024
1 parent 19c4436 commit 0e327a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion app/middleware/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ module.exports = async function httpproxy(ctx, next) {
},
timeout: 5 * 60 * 1000, // 五分钟
proxyTimeout: 5 * 60 * 1000, // 五分钟
changeOrigin: true
changeOrigin: true,
onError: (err, req, res, target) => {
app.logger.info('http-proxy-middleware error', err, target);
}
}))(ctx,next)
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"file-saver": "^1.3.3",
"history": "^4.7.2",
"html2canvas": "^0.5.0-beta4",
"http-proxy-middleware": "2.0.4",
"http-proxy-middleware": "2.0.6",
"js-cookie": "^2.2.0",
"koa-connect": "^2.0.1",
"lodash": "^4.17.4",
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3916,9 +3916,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001400:
version "1.0.30001434"
resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001434.tgz#ec1ec1cfb0a93a34a0600d37903853030520a4e5"
integrity sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA==
version "1.0.30001622"
resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001622.tgz"
integrity sha512-H+g7cwL2r1TzN4HpM1ZzhaOf7zwMNAZomX/uao6flMFsT3sLIpxi9H3QMo7U0KPWr0a8/Zvl8sQgrr6RXJ0HRw==

capture-stack-trace@^1.0.0:
version "1.0.2"
Expand Down Expand Up @@ -9135,10 +9135,10 @@ http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1:
agent-base "6"
debug "4"

http-proxy-middleware@2.0.4:
version "2.0.4"
resolved "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-2.0.4.tgz#03af0f4676d172ae775cb5c33f592f40e1a4e07a"
integrity sha512-m/4FxX17SUvz4lJ5WPXOHDUuCwIqXLfLHs1s0uZ3oYjhoXlx9csYxaOa0ElDEJ+h8Q4iJ1s+lTMbiCa4EXIJqg==
http-proxy-middleware@2.0.6:
version "2.0.6"
resolved "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f"
integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==
dependencies:
"@types/http-proxy" "^1.17.8"
http-proxy "^1.18.1"
Expand Down

0 comments on commit 0e327a2

Please sign in to comment.