pusher / pusher-websocket-unity

Pusher Channels Unity Client Library
MIT License
27 stars 20 forks source link

Can't subscribe to private channels #8

Closed heath3n closed 4 years ago

heath3n commented 4 years ago

Unity: 2019.8.x .NET: 4.x Pusher: 1.0.2


Issue: When attempting to subscribe to a private channel, the Unity client remains in a cycle of Waiting to Reconnect / Disconnected states. I am using the configuration from the example along with an extremely minimal Express server that simply returns either a 403 Forbidden or attempts to authorize the incoming socket ID. Both cases fail.

Solution: After some debugging, I have identified that the jsonAuth string (which should contain the authorization received from the server) is actually the string "System.Net.Http.StreamContent". This of course causes the following exception to be thrown: System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 0, position 0.

The ability to connect to private channels is of critical importance to us.

damdo commented 4 years ago

Hey @heath3n, thank you for reporting this. The issue has been fixed in the underlying library: pusher-websocket-dotnet v1.1.1, which has been packaged for Unity in the 1.1.1+191127 release