From a516976e35570e1a4108fa2eb6d66334aece0e99 Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Sat, 1 Aug 2026 17:57:00 +0800 Subject: [PATCH] Revert "feat: use pure direct connection to official api.fish.audio without any forced proxies" This reverts commit 3ecae7b0bc28d146f56fe64fbf4782584a8c0e41. --- CloudServer/server.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/CloudServer/server.js b/CloudServer/server.js index 1f577b8..7c442e0 100644 --- a/CloudServer/server.js +++ b/CloudServer/server.js @@ -2493,14 +2493,24 @@ app.post('/api/tts/generate', express.json(), async (req, res) => { body: requestBody }; + // Always try to use local proxy first if we are on a Windows machine + if (!proxyUrl && os.platform() === 'win32') { + proxyUrl = 'http://127.0.0.1:7890'; + } + let response; try { response = proxyUrl - ? await requestViaProxy('https://api.fish.audio/v1/tts', options, proxyUrl) - : await requestDirect('https://api.fish.audio/v1/tts', options); + ? await requestViaProxy('https://fishaudio.fse-media.group/v1/tts', options, proxyUrl) + : await requestDirect('https://fishaudio.fse-media.group/v1/tts', options); } catch (e) { - console.log(`[TTS] Direct connection failed: ${e.message}`); - throw e; + // Fallback for Windows if local proxy fails + if (os.platform() === 'win32' && proxyUrl === 'http://127.0.0.1:7890') { + console.log(`[TTS] Local proxy failed, attempting direct connection...`); + response = await requestDirect('https://fishaudio.fse-media.group/v1/tts', options); + } else { + throw e; + } } if (!response.ok) {