Describe the bug
On my Android phone I have both wifi and mobile data on. But wifi has NO internet and mobile data has internet. My Android app uses Java-WebSocket to connect to the websocket server via IP (eg. 192.168.1.3) but times out. But if mobile data is turned off, then it will work.
To Reproduce
Steps to reproduce the behavior:
- Have a WebSocket server (eg. with IP 192.168.1.3) on your local area network.
- Your LAN has no internet
- On your Android phone, switch on Wifi to connect to the LAN with no internet.
- On your Android phone, switch on Mobile data so you do have internet.
- Run Android app that runs code that connects to the WebSocket Server, eg:
MyWebSocketClient(URI("ws://192.168.1.3:8888/websocket-handler/"))
Example application to reproduce the issue
Do I really need to?
Expected behavior
It should just work. If not, then how do you explicitly tell the WebSocketClient to connect to the Wifi network instead of the Mobile network?
Workaround
Switch off mobile data.
Debug log
W/System.err: an error occurred: java.net.ConnectException: failed to connect to /192.168.1.3 (port 8888) from /:: (port 46537): connect failed: ETIMEDOUT (Connection timed out)
I/System.out: closed with exit code -1 additional info: failed to connect to /192.168.1.3 (port 8888) from /:: (port 46537): connect failed: ETIMEDOUT (Connection timed out)
Environment(please complete the following information):
- Version used: 1.3.9
- Java version: 1.7 or 1.8
- Operating System and version: ArchLinux
- Endpoint Name and version:
- Link to your project:
Additional context
None
Describe the bug
On my Android phone I have both wifi and mobile data on. But wifi has NO internet and mobile data has internet. My Android app uses Java-WebSocket to connect to the websocket server via IP (eg. 192.168.1.3) but times out. But if mobile data is turned off, then it will work.
To Reproduce
Steps to reproduce the behavior:
Example application to reproduce the issue
Do I really need to?
Expected behavior
It should just work. If not, then how do you explicitly tell the WebSocketClient to connect to the Wifi network instead of the Mobile network?
Workaround
Switch off mobile data.
Debug log
Environment(please complete the following information):
Additional context
None