0

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.

3
  • I'm not an expert by any means, but I note the source address for all three tries in that log is an IPv6 address and it's trying to connect to an IPv4 host. Can you see if the https connection that works says it's coming from an IPv4 address?
    – tsc_chazz
    Commented Sep 14, 2023 at 18:51
  • @tsc_chazz O man! This is a clue. The server itself supports IPv6, but the DNS Name server is IPv4 only. The NS contains the AAAA, but it itself doesn’t support IPv6. May be this is the root of the problem? Commented Sep 15, 2023 at 10:37
  • I don't know enough about your setup to guess, but I do note that the address is resolving, even if to IPv4. So the DNS is at least somewhat functional. My own initial suspicion would lie with whatever is doing the V6 to V4 translation... but again, I'm no expert.
    – tsc_chazz
    Commented Sep 15, 2023 at 15:09

0

You must log in to answer this question.

Browse other questions tagged .