Replies: 1 comment 2 replies
-
Hi! Could you please provide the details of the socket.on("connect_error", (err) => {
console.log(err); // <-- this
}); Any additional logs that could help us? Does it work when enabling HTTP long-polling? PS: for the next time, could you please provide your code as text, and not as image? It's easier to search/copy. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
While developing a React Native application with Expo, I've encountered an issue with WebSocket connections. The connections work fine in the simulator and Expo Go, but they fail after building the app using Expo for physical devices through Testflight or Google Play.
Environment & Dependencies:
Expo SDK Version: 51.0.8
React Native Version: 0.74.1
socket.io-client Version: 4.7.5
Backend Technology: NestJS 10.0.0 + Socket.IO 4.7.5
Build Tool: Expo build (eas)
Reproduction Steps:
WebSocket connections are functional in the development environment.
Build the app using Expo build.
Install the built app on a physical device through Testflight or Google Play.
Notice that WebSocket connections are not established.
Expected Behavior:
WebSocket connections should be consistent across all environments, including the production build.
Actual Behavior:
WebSocket connections cannot be established in the production build.
Additional Information:
I've confirmed that the WebSocket server URL is consistent across all environments, and it's a public network server, not local.
The app uses the HTTPS protocol with an SSL certificate, and the NestJS server has CORS set to *.
WebSocket connections work normally in browsers, iOS simulators, and Expo Go.
Beta Was this translation helpful? Give feedback.
All reactions