Unity 5.3 WebGL Photonv4 websocket connection problem

Options
Hello!

We are running our own server using your latest server release (v4) and Photon3Unity3D.dll v4.0.5.0 for our unity WebGL client. However we are not even getting any error message when we are trying to connect through websockets. I've seen the loadbalancer example and checked my that ports are open as well. (PhotonConfig is correct too)
Is there a working example with a websocket connection? Should I expect this to work?

Thank you,

Comments

  • vadim
    Options
    Hi,

    We have request to support very like this. If it's yours, please check the mail. If not, let us know here.
  • Tobias
    Options
    The Photon Unity SDK (Photon3Unity3D.dll) v4.0.5.0 does not support WebGL export yet.
    It can be added but was low prio for us, so far.

    Do you build a Realtime game or a Turnbased one?
    You could use PUN for realtime games as it supports WebGL. We are working on a PUN for Unity 5.3 update (exports changed, etc).
  • Maven_1
    Options
    Hello!

    Thanks Vadim for the support via the mails.
    @Tobias: We have a realtime game. We've managed to find a solution by merging PUN and Server SDK. Here's how:
    First let me tell you about our setup:
    ServerSide:
    Self Hosted with Photon-OnPremise-Server-SDK_v4-0-27-10871
    Address: ws://localhost:9090 (Specifying protocol is important)
    Protocol: ConnectionProtocol.Websocket
    ClientSide:
    Unity: v5.3.0f4 in WebGL mode
    From the PUN Package we only got :
    Photon3Unity3D.dll, v4.0.0.12 (We discarded the v4.0.5.0 from Server SDK)
    SocketWebTcp, WebSocket class. Websocket.jslib, websocket-sharp.dll.

    What I did is to simply copy what you've already written in other classes connection methods. For client-side these few lines of code was enough to convert our connection from TCP to WebSocket:
    _peer = new PhotonPeer(this, ConnectionProtocol.WebSocket);
    _peer.SocketImplementation = typeof(SocketWebTcp);

    Then we got a websocket connection :) It's working well so far. Note: Also we tried wss:// and it works too.

    Thanks,


  • Tobias
    Options
    @Maven_1: Awesome! Thanks for the summary.
    We know this is tedious and we will include WebSockets asap in the Photon Unity SDK, too. So updates are no longer a problem :)