Connecting with websocket and building WebGL
Options
Hi, I'm trying to get work Unity3D with websocket.
I've tried 2 dlls - Photon3Net.dll and Photon3Unity3D.dll.
If I try to connect with websockets with Photon3DotNet.dll it works fine in editor, but when I try to run project with WebGL it gets stuck on
, so I guess I need, the second dll, because of this support (or not?). But, when I try the second Unity3D.dll, then It does nothing. I don't get any error.
So my question is - Does anybody know how to get websockets working with unity WebGL?
I've tried 2 dlls - Photon3Net.dll and Photon3Unity3D.dll.
If I try to connect with websockets with Photon3DotNet.dll it works fine in editor, but when I try to run project with WebGL it gets stuck on
MissingMethodException: No constructor found for ExitGames.Client.Photon.SocketWebTcp::.ctor(ExitGames.Client.Photon.TPeer)
, so I guess I need, the second dll, because of this support (or not?). But, when I try the second Unity3D.dll, then It does nothing. I don't get any error.
So my question is - Does anybody know how to get websockets working with unity WebGL?
0
Comments
-
You're posting in the DotNet category, which suggest you're not using PUN?
Which SDK version are you using?
Part of the problem is, that Unity didn't include a websocket implementation in the build. This may be code stripping or it might be due to incomplete setup.
We need to know your SDK and version to help.0 -
I'm using the newest version - 4.1.1.17.
I found the websocket folder in unity's SDK and I did everything from Readme-Photon-WebSocket.txt.
I'm gettingSystem Exception: Thread creation failed
now.
I'm stuck with this about 3 hours, maybe I'm missing something..?0 -
Thread creation is impossible in WebGL/JS. Does your code try to use a Thread?
Do you get a callstack for that?
0 -
I'm trying this with new unity project - I made script, that contains only connection.
It works in editor, windows build but when I try to run it in WebGL, it just throws this exception, without any callstack (callstack is lost in IL2CPP).0 -
Hi @Twinity,
Thank you for choosing Photon!
In your project, make sure to have a "WebSocket" or "PhotonWebSocket" folder under "Assets/Plugins".
It should be inside the "PhotonAssets" folder of the SDK.
Also, make sure to set WSS as the transport protocol before connecting:
either pass it to the constructor of the class that extends LoadBalancingClient orthis.TransportProtocol = ConnectionProtocol.WebSocketSecure;
0