Can't get BestHTTPWebsocketAdapter to work
bleedingpixels opened this issue · 1 comments
bleedingpixels commented
Hello, thanks for providing the BestHTTP websocket adapter.
I can get websocketsharp to work, but the BestHTTPWebsocketAdapter provided doesn't work for me. It isn't a impeding issue and I can still continue developing using PhoenixSharp but I want to eventually move to BestHTTP because it is more focused for unity.
I get this error and the phoenix server side doesn't spit out a cmd reponse lines.
W [HTTPResponse]: ws://localhost:4000/socket/websocket - Failed to read Status Line! Retry is enabled, returning with false.
UnityEngine.Debug:LogWarning(Object)
BestHTTP.Logger.DefaultLogger:Warning(String, String) (at Assets/Best HTTP (Pro)/BestHTTP/Logger/DefaultLogger.cs:63)
BestHTTP.HTTPResponse:Receive(Int32, Boolean) (at Assets/Best HTTP (Pro)/BestHTTP/HTTPResponse.cs:216)
BestHTTP.HTTPConnection:Receive() (at Assets/Best HTTP (Pro)/BestHTTP/HTTPConnection.cs:657)
BestHTTP.HTTPConnection:ThreadFunc(Object) (at Assets/Best HTTP (Pro)/BestHTTP/HTTPConnection.cs:230)
Mazyod commented
I simply extracted that code from my live project, so I'm pretty sure it should work. Can you please share more, or send me your code to look at?
Here is more of my code:
// initialization
new Socket(
new BestHTTPWebsocketFactory(),
new Socket.Options() {
heartbeatInterval = null, // we do a custom heartbeat
timeout = TimeSpan.FromSeconds(10),
logger = G.Log,
delayedExecutor = new CoroutineDelayedExecutor()
})
// connection
socket.Connect(parameters.connect.url, new Dictionary<string, string> {
{ "token", parameters.connect.token }
});
// where URL is simply...
"wss://my.domain.com/socket"