I'm the dev of mobile app game for Android. The app is using both HTTPs
and WebSocket
connection to the same server. The app is live and works well for most users.
I have one user who said the app is not working for him. I was able to obtain the logs and see that the user connects via mobile cellular network via HTTPs connection to the server with no problems, but the socket connection to the same server/port fails. The error connecting to the socket:
Failed to connect to 'api.mafia-game.net:443': failed to connect to api.mafia-game.net/161.97.93.23 (port 443) from /:: (port 41656): connect failed: ETIMEDOUT (Connection timed out)
Failed to connect to 'api.mafia-game.net:443': failed to connect to api.mafia-game.net/161.97.93.23 (port 443) from /:: (port 41658): connect failed: ETIMEDOUT (Connection timed out)
Failed to connect to 'api.mafia-game.net:443': failed to connect to api.mafia-game.net/161.97.93.23 (port 443) from /:: (port 41660): connect failed: ETIMEDOUT (Connection timed out)
From this log I see that socket timed out every time and the app is trying to use different local ports every time. I also see that IP resolved correctly and IPv4 is used.
I understand that the user can't connect because of something in his network (like closed ports etc).
My question: how is it possible that the socket connection is not working, but HTTPs connection is working fine on the same server and port (443)?
I know that the socket implementation on server is correct, because it works for the most users. Plus the server is not refusing the connection as I can see, but the connection simple timed out, like if the user can't receive the answer back.
To make the socket connection I'm using Java library com.neovisionaries.ws.client
.
https
connection that works says it's coming from an IPv4 address?