please be patient with me because this is my first question ever on this platform. Thanks. This is the code for a minimal server using the secure websocket protocol wss:// in godot (GDScript):
It works as expected when i connect from my home to my Virtual Private Server hosted in Germany or via VPN from other locations (e.g. US or Europe). It does not work as expected when friends connect from India or Australia or if i reproduce it with a VPN (e.g. Argentina or Australia).
index.js:8 WebSocket connection to 'wss://(hidden):port/' failed: Error in connection establishment: net::ERR_SOCKET_NOT_CONNECTED.
I looks like the connection fails only if the physical distance between server and client is that long.
The problem might be related to SSL because everything works as expected when i use the normal websocket protocol. I tested the openssl -connect command from home and via VPN: both are good. I also checked my ssl configuration on https://decoder.link/sslchecker/. No issues detected.
This problem might be related to godot because I set up a nodejs secure websocket server, this works, even when i connect from Australia.
Now i dont really know how to proceed to fix this issue so i ask you to point me in the right direction.
Useful documentation on godot docs: WebSocketServer WebSocketClient
Edit 1:
After more tests it got more confusing: When connecting from India with traffic on the internet connection:
WebSocket connection to 'wss://myDomain:port/' failed: Connection closed before receiving a handshake response
connnetion error
connection close request from server received... client will close the connection
disconnected unexpected
sometimes it even works (when network is not busy)
When connection from Australia: sometimes the ERR_SOCKET_NOT_CONNECTED
or the Connection closed before receiving a handshake response connnetion error
error comes up.
Edit 2:
only Firefox works, Chrome or Native client don't. I seems Firefox can establish the connection better if the distance is very big between server and client.