NativeWebSocket icon indicating copy to clipboard operation
NativeWebSocket copied to clipboard

Wss connection works on WebGL builds but not on mobile or editor for some URLs

Open Woody4618 opened this issue 2 years ago • 2 comments

Hey, when i try to connect to this url, it works fine in the WebGL builds but not in editor or mobile builds: wss://api.devnet.solana.com/

The error is: Error! Unable to connect to the remote server

This URL works in Editor: wss://devnet.genesysgo.net/

Any Ideas how I can solve the problem? Or in which direction I need to look? When I use BestHTTP package it works, so I assume there should be some way this can be fixed in this package hopefully.

This is the Stacktrace: at System.Net.WebSockets.WebSocketHandle.ParseAndValidateConnectResponseAsync (System.IO.Stream stream, System.Net.WebSockets.ClientWebSocketOptions options, System.String expectedSecWebSocketAccept, System.Threading.CancellationToken cancellationToken) [0x0010a] in <35e40e3005db46479c17ef7dd12bbfe4>:0 at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore (System.Uri uri, System.Threading.CancellationToken cancellationToken, System.Net.WebSockets.ClientWebSocketOptions options) [0x00383] in <35e40e3005db46479c17ef7dd12bbfe4>:0 at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore (System.Uri uri, System.Threading.CancellationToken cancellationToken) [0x000d1] in <35e40e3005db46479c17ef7dd12bbfe4>:0 at NativeWebSocket.WebSocket.Connect () [0x001a5] in /Assets/WebSockets/WebSocket.cs:471

Woody4618 avatar Dec 18 '22 19:12 Woody4618

I have a similar problem 👍

EDIT: Nevermind, I just had to wait for DNS to propagate. It now works everywhere.

J0m1ty avatar Dec 21 '22 02:12 J0m1ty

I "solved" it by using this repository for WebGL then creating a common interface and using socket sharp for the other platt forms and use a compiler flag to choose depending on the platt form. Sadly I couldn't figure out what the cause of the problem was.

Woody4618 avatar Dec 22 '22 17:12 Woody4618