Skip to content

Commit 29c94d1

Browse files
committed
Enhance proxy server message parsing for app preview
- Update regex pattern to match new proxy server message format - Add better detection for app preview availability messages - Improve URL extraction for both proxy and original server URLs
1 parent 5bf8e7f commit 29c94d1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/hooks/useRunApp.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ export function useRunApp() {
2525
const setPreviewErrorMessage = useSetAtom(previewErrorMessageAtom);
2626

2727
const processProxyServerOutput = (output: AppOutput) => {
28+
// Check for the new format: "🚀 App preview available at http://localhost:56277 (proxied from local port 5174)"
29+
const newFormatMatch = output.message.match(
30+
/🚀 App preview available at (http:\/\/localhost:\d+) \(proxied from local port (\d+)\)/,
31+
);
32+
if (newFormatMatch) {
33+
const proxyUrl = newFormatMatch[1];
34+
const localPort = newFormatMatch[2];
35+
const originalUrl = `http://localhost:${localPort}`;
36+
setAppUrlObj({
37+
appUrl: proxyUrl,
38+
appId: output.appId,
39+
originalUrl: originalUrl,
40+
});
41+
return;
42+
}
43+
44+
// Fallback to old format for backward compatibility
2845
const matchesProxyServerStart = output.message.includes(
2946
"[AliFullStack-proxy-server]started=[",
3047
);

0 commit comments

Comments
 (0)