diff --git a/src/pages/playRoom/hooks/usePlayers.ts b/src/pages/playRoom/hooks/usePlayers.ts index 255007a..e91d13b 100644 --- a/src/pages/playRoom/hooks/usePlayers.ts +++ b/src/pages/playRoom/hooks/usePlayers.ts @@ -14,7 +14,7 @@ export default function usePlayersCards (): [PlayerInfoType[], PlayerInfoType | const navigate = useNavigate(); useEffect(() => { - const socket = io('http://152.136.254.142:4001'); + const socket = io('https://152.136.254.142:4001'); // client-side socket.on('connect', () => { console.log('========== we are connecting ws ==========='); diff --git a/vite.config.ts b/vite.config.ts index d724160..9c6671b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -43,7 +43,7 @@ export default defineConfig({ port: 3333, // 指定服务器端口 open: true, // 开发服务器启动时,自动在浏览器打开 strictPort: false, // 设为 true 时,若端口已被占用会直接退出,不会尝试下一个可用端口 - https: false, // 是否开启 https 服务 + https: true, // 是否开启 https 服务 cors: true, // 允许跨域 // 配置代理 proxy: {