New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect to WebSocket Server on local network (via wifi + no internet) if mobile data is on (with internet). #814
Comments
Hello @robinchew, Is there any android setting with which you can define which connection is used? This is a java lib and therefore we cannot use internal android apis. But I am pretty sure someone already had such an issue before you. In my eyes it has to be defined by the application and not by the lib (and we simple cannot). Best regards, |
Any update ? |
I'm still unsure how to solve it on the Android side. |
If you can't solve it in android how can I even solve this in java? |
If this isn't a Java-WebSocket issue, but an Android issue, then I'm open to solutions. Unfortunately I haven't found one yet, hopefully someone hitting this same issue is able to provide some insight. |
Initially, I thought perhaps it was possible to pass eg. |
I have the same problem, and don't know how to fix it. The connection is okay with wi-fi, but does not work at all on cellular. Please help |
I fix the same problem by using the following solution: |
Closing this issue as a solution is provided |
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
The text was updated successfully, but these errors were encountered: