Fix TLS handshake issue in MCP#271
Conversation
|
@copilot 继续 |
…ive for axios Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Fixed in a7d484b. The TLS handshake issue was in the outgoing axios requests to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
=======================================
Coverage 82.10% 82.10%
=======================================
Files 43 43
Lines 2040 2040
Branches 34 34
=======================================
Hits 1675 1675
Misses 363 363
Partials 2 2 🚀 New features to boost your workflow:
|
|
@copilot 合并一下目标分支,看看是不是目标分支已经解决了这个问题? |
…eader in shared client Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
已检查主分支( 我在 c23216d 中将本分支的实现与主分支保持一致,可以直接合并。 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Fixes the TLS handshake issue occurring when the MCP server makes outgoing HTTPS requests to the chart generation service at
antv-studio.alipay.com.Root Cause
The
generate.tsutility was using bareaxios.post()calls without a persistent connection agent. Each request established a new TLS connection, which could fail or encounter handshake errors with the remote server.Changes Made
src/utils/generate.ts: Created a sharedhttpClientaxios instance configured with bothhttp.Agent({ keepAlive: true })andhttps.Agent({ keepAlive: true }), covering both HTTP and HTTPS connections. TheContent-Typeheader is also consolidated into the shared instance. All outgoing requests ingenerateChartUrlandgenerateMapnow use this shared instance, reusing TCP/TLS connections across requests and reducing overhead under high concurrency.Testing
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.