-
Notifications
You must be signed in to change notification settings - Fork 33
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
Can't connect #29
Comments
You are trying to connect to a non-ssl endpoint and your application isn't configured to do that. This has nothing to do with this client or even websockets. If you tried to hit a regular REST endpoint on non-ssl localhost the same thing would happen. You should read this. Heres some excerpts that should help in AndroidManifest.xml in /res/xml/network_security_config
|
Thanks for your response. Not only that, but I was using an Android emulator which requires using specially-designated port 10.0.2.2 to connect to I'm still having an issue connecting. The request is now going through, but I'm getting a
I can see that the source code for Code from
My javascript phoenix socket client works fine and I don't believe it does anything under the hood to change the protocol - it's always Is there a reason for doing this? Any suggestions are appreciated! |
The biggest help for debugging would be to create your own okhttp client and log all requests/responses. in your build.gradle create your client
create your phoenix client
Maybe this will help shed some light on your issue. I can say that this library is working for me, although I did not set up the phoenix backend. |
Thanks. The error I'm getting makes perfect sense to me. I'm wondering how this could work as my Phoenix backend is expecting a For example, my endpoint file is:
so the I don't see anything in the Phoenix app that would automatically give the As a side note, I came across this issue in the OkHttp library that is used by this library. I assume this is part of the reason why this library does the silent replacement of Thanks again for your input. |
Update: I'm able to open the connection by defining an http route in my
The logic for deriving the So now the socket connection is open, but I receive this error almost immediately:
Looks like it might be related to this issue from OkHttp library. The solution proposes adding Still, this doesn't totally explain why I'm seeing this error immediately after socket opening, especially because by default Phoenix websocket shouldn't timeout for at least a minute (at least how I'm reading that document). |
@dustinconrad, did you need to configure anything in your Phoenix app to get this running? I'm still stuck here. No issues when using Javascript client for Phoenix channels, but no luck with this android client. |
Hey @MarkPare, sorry I can't be more help from the elixir side, but I did not set that portion up. It just worked when I started hitting the endpoint. |
Hey guys, thanks for trying to work this out together already. I'll try to take some time this weekend to dig a little into this but may be delayed by the holidays! |
@dsrees , thanks for your response. I'm happy to continue debugging this myself; I'm just kind of stuck right now. Below are my Elixir and Phoenix versions if that's helpful. Elixir 1.7.3 |
@MarkPare were you ever able to resolve this? I have not been able to reproduce your issue on my end |
@dsrees I was never able to solve this and had to opt for a different solution. When I get a chance I'll post something that's reproducible and testable. Thanks. |
Thanks for the library.
I'm having issues connecting and I haven't been able to track down the cause.
INTERNET
andACCESS_NETWORK_STATE
permissions have been added toAndroidManifest.xml
.Here's my activity:
And here's my log:
Any suggestions are appreciated!
The text was updated successfully, but these errors were encountered: