Webgl + Websocket unity plugin of jonas

Hi there,
I am writing because i started having problems with webgl + websocket + UnityPlugin in a recent version of unity 5.2.0f2 but in 5.1.0f2 was working fine.

The unity plugin i am using is here: (the one that is in the documentation)

http://files.unity3d.com/jonas/WebSockets.unitypackage

The error is a empty string when want to create a Websocket in the browser:

exception thrown: SyntaxError: Failed to construct ‘WebSocket’: The URL ‘’ is invalid.,Error: Failed to construct ‘WebSocket’: The URL ‘’ is invalid.
at Error (native)
at _SocketCreate (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:1:253722)
at Array.Een (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:34:951726)
at Object.P4m [as dynCall_ii] (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:34:915035)
at invoke_ii (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:1:363798)
at Array.xBf (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:24:230910)
at Object.e5m [as dynCall_iiii] (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:34:917097)
at invoke_iiii (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:1:367006)
at Array.wBf (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:24:230086)
at Array.B3l (http://localhost.makingfun.com:8080/fun/r/js/DominionWebGL/Release/DominionWebGL.js?v=1440711594504:5:1243957)Module.printErr @ canvas:747Browser.mainLoop.runIter @ DominionWebGL.js?v=1440711594504:1Browser_mainLoop_runner @ DominionWebGL.js?v=1440711594504:1
UnityConfig.js?v=1440711594504:76 Invoking error handler due

I did a trace of the code, and i found that the communication between C# code and javascript inside a plugin of type string is done using pointers, as is in this documentation:

The problem is that in the file of the plugin: Websocket.jslib line 7,

var str = Pointer_stringify(ptr); // return empty string

Is returning a empty string, but i am sure when i create the socket i am sending the correct url.

So here are all the system versions:
SO: Mac Yosemite 10.10.1
Browser: Chrome 44.0.2403.157 (64-bit)
Unity: 5.2.0f2

Maybe the plugin is code is old? What should i change to make it work?

Thanks!

You can find the current version of the plugin here, in case you are using an older one:

Hi there,
Worked, yes the version from that URL works.
Also the plugin in Websocket.jslib has hardcoded 2 subprotocols, Maybe should leave that to the client programmer to define that.

Thanks!