Using socket.io in Expo, see the it in action: https://expo.io/@community/socket-io-example
You need to use https for your web socket server, so I recommend using ngrok for it. Instructions are inline in app/main.js, but also copied here for your convenience:
// INSTRUCTIONS:
// replace with your local ngrok url, eg: https://brent123.ngrok.io
// start ngrok with ngrok http 3000 --subdomain=brent123
// where the subdomain is whatever subdomain you want