[147] Websocket defines protocol when not required

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Link to .capx file (required!):

    docs.google.com/file/d/0By_A2aN9Y8fyZjdQdHNSUDJOYUE/edit

    Steps to reproduce:

    1. Make sure Chrome Debug Tools are enabled (or different browser equivalent, you need to make sure you can view the headers)

    2. Run the capx. It will try to connect to the echo server (echo.websocket.org)

    3. On Chrome, open the Inspector and go to Network. Filter the results to Websocket. If there are no entries, refresh the page.

    Observed result:

    C2Websocket defines the Sec-Websocket-Protocol header as undefined. This results in a header mismatch with servers that do not define a protocol.

    Expected result:

    Similar to the case of websocket.org/echo.html, Sec-Websocket-Protocol should not exist in the request headers, unless defined. This can be verified by using the above steps on the websocket.org echo page

    Browsers affected:

    Chrome: yes

    Operating system & service pack:

    Windows 7

    Construct 2 version:

    r147 and r146

  • The problem was with <C2PluginRoot>/websocket/runtime.js:142 :

    this.ws = new WebSocket(url_, requireProtocol_ === "" ? undefined : requireProtocol_)

    Replacing this line with the more verbose:

    if (requireProtocol_ === "") this.ws = new WebSocket(url_);

    else this.ws = new WebSocker(url_, requireProtocol_);

    fixes the problem in question, but I'll leave the fix up to you guys.

    Sorry if I wasn't supposed to do that :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, should be fixed in the next build.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)