0.3.5 共享功能修复
This commit is contained in:
@@ -54,9 +54,13 @@ export function ConvexClientProvider({ children }: ConvexClientProviderProps) {
|
||||
}
|
||||
|
||||
// 未配置 env:使用当前主机名,端口固定 3210,并跟随当前页面协议(http/https)。
|
||||
// https 场景下浏览器禁止 ws://,因此默认走同源反代 `/convex`(需要 server 支持 Upgrade 透传)。
|
||||
if (browserProtocol === "https:") {
|
||||
return normalize(`${window.location.origin}${convexProxyPath}`);
|
||||
}
|
||||
|
||||
const hostname = window.location.hostname;
|
||||
const protocol = "http:";
|
||||
return normalize(`${protocol}//${hostname}:3210`);
|
||||
return normalize(`http://${hostname}:3210`);
|
||||
};
|
||||
|
||||
const convexUrl = getConvexUrl();
|
||||
|
||||
Reference in New Issue
Block a user