How do you make Socket.io work with a CapacitorJS native app for iOS or Android (even on emulators)?
Pass your backend server URL to the socket.io client on initialisation, as follows:
import io from 'socket.io-client';
export const connect = () => {
const socket = io("https://www.example.com/", { options });
return socket;
};
as per the official documentation: https://socket.io/docs/v3/client-initialization/#from-a-different-domain