如何让Socket.io与iOS或Android的CapacitorJS原生应用一起工作(即使是在模拟器上)?
gk7wooem1#
初始化时,将您的后端服务器URL传递给socket.io客户端,如下所示:
import io from 'socket.io-client'; export const connect = () => { const socket = io("https://www.example.com/", { options }); return socket; };
字符串根据官方文档:https://socket.io/docs/v3/client-initialization/#from-a-different-domain
1条答案
按热度按时间gk7wooem1#
初始化时,将您的后端服务器URL传递给socket.io客户端,如下所示:
字符串
根据官方文档:https://socket.io/docs/v3/client-initialization/#from-a-different-domain