Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions web_demo/client/src/pages/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ const buildURL = ({
textSeed,
audioSeed,
}: {
workerAddr: string;
workerAddr: string; // e.g. "iiz6uvvoybsdj7-8000.proxy.runpod.net"
params: ModelParamsValues;
workerAuthId?: string;
email?: string;
textSeed: number;
audioSeed: number;
}) => {
// 使用 Vite 代理方式连接后端
const wsProtocol = (window.location.protocol === 'https:') ? 'wss' : 'ws';
// workerAddr 包含模式信息用于代理路由
const url = new URL(`${wsProtocol}://${window.location.host}/api/${workerAddr}`);
const wsProtocol = (window.location.protocol === "https:") ? "wss" : "ws";

// Connect directly to backend worker on /api/chat
const url = new URL(`${wsProtocol}://${workerAddr}/api/chat`);

if (workerAuthId) {
url.searchParams.append("worker_auth_id", workerAuthId);
}
Expand All @@ -67,7 +68,6 @@ const buildURL = ({
url.searchParams.append("audio_seed", audioSeed.toString());
url.searchParams.append("repetition_penalty_context", params.repetitionPenaltyContext.toString());
url.searchParams.append("repetition_penalty", params.repetitionPenalty.toString());
// Add image params if given
if (params.imageUrl != undefined) {
url.searchParams.append("image_url", params.imageUrl.toString());
url.searchParams.append("image_resolution", params.imageResolution.toString());
Expand All @@ -76,7 +76,6 @@ const buildURL = ({
return url.toString();
};


export const Conversation: FC<ConversationProps> = ({
workerAddr,
workerAuthId,
Expand Down
9 changes: 3 additions & 6 deletions web_demo/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import topLevelAwait from "vite-plugin-top-level-await";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());

const simplexTarget = env.VITE_SIMPLEX_TARGET || "http://localhost:11236";
const simplexTarget = env.VITE_SIMPLEX_TARGET || "http://localhost:8000";

// proxy config for half-duplex (11236)
const proxyConf: Record<string, string | ProxyOptions> = {
Expand All @@ -31,11 +31,8 @@ export default defineConfig(({ mode }) => {
return {
server: {
host: "0.0.0.0",
port: 80,
https: {
cert: "./cert.pem",
key: "./key.pem",
},
port: 8010,
https: false,
proxy: {
...proxyConf,
}
Expand Down