Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCurrent master doesn't build for Unity web player #52
Comments
ssfrr
referenced this issue
Jun 14, 2014
Open
Websocket connection doesn't work after reload on OSX Web Player #51
This comment has been minimized.
This comment has been minimized.
I strongly suggest to build websocket-sharp.dll with MonoDevelop, and use it in Unity. |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Jun 24, 2014
@sta @ssfrr Hi guys, i've started using websocket-sharp and am very pleased with it! Thanks! I have a small issue with the library for the webplayer. Although when i use the webplayer in the editor, everything works fine, when i build for the actual webplayer, i get a plain error (in the console) saying "Error getting handsake from Socket.IO host instance: An error occurred performing a WebClient request.". No more details. Currently i'm using the .dll but from what i've heard, .dlls are not compatible with the web player. Could this be the issue? and fyi how can i safely adapt the c# code for my game? |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Jun 24, 2014
@ssfrr have you mannaged to get the webplayer working in the browser? |
This comment has been minimized.
This comment has been minimized.
On @sta's advice I built it in MonoDevelop into a DLL and included the DLL in my Assets folder, and it worked like a charm in both the web and desktop players. I also thought you couldn't use DLLs in web-player, but I think as long as the DLL is purely managed code (AFAIK basically it just can't call out to native libraries) then it seems to work fine. Note that the fix in #51 is necessary if you want it to work properly on OSX. |
This comment has been minimized.
This comment has been minimized.
How did you use websocket-sharp at that time? Copied code or DLL built yourself? |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Jun 26, 2014
@sta copied the dll :) is that not ok? i've built the project and used the resulting dll. I haven't included the fix from #51 but it should still work i think. Note that on top, i'm using socket.io (https://github.com/kaistseo/UnitySocketIO-WebSocketSharp) |
This comment has been minimized.
This comment has been minimized.
I think, perhaps, those .dlls mean unmanaged (native) dlls (, and requires Unity Pro). websocket-sharp.dll is managed (.NET assembly) dll, so it doesn't apply to the above .dlls.
Have you gotten same error still? |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Jun 26, 2014
@sta yes, still. I have Unity Pro 4.5. I get this error for the requestHandshake. On further debugging (placing while(exception!=null) { Debug.Log("ex: "+ex.Message); e = e.InnerException; } i also get: socket client error: SocketIO.Cent.Connect threw an exception and in the Connect() method: socket client error: Object reference not set to an instance of an object |
This comment has been minimized.
This comment has been minimized.
RDeluxe
commented
Dec 4, 2014
@badescuga did you find a fix for this ? I am exactly in the same situation. Everything is working fine in the editor (in webplayer mode, with socket policies settled, etc.) but in chrome or firefox I got the same error: Handshake error stacktrace at System.Net.WebClient.DownloadDataCore (System.Uri address, System.Object userToken) [0x00000] in :0 at System.Net.WebClient.m__E (System.Object state) [0x00000] in :0 Seems to come from this : byte [] DownloadDataCore (Uri address, object userToken)
|
ndevenish
referenced this issue
Aug 21, 2015
Closed
HttpServer Incompatible with Unity .net 3.5 subset #154
This comment has been minimized.
This comment has been minimized.
rosarionakkocom
commented
Jun 25, 2016
Just export for webgl, problem solved. |
ssfrr commentedJun 14, 2014
There are some tweaks I had to make in order to get the library to build for the Unity Web Player. I'm not 100% sure how safe the changes are. Most of the issues are API calls that aren't present in the System libraries that the web player gets built with. I'm not using compression or encryption so mostly I just commented out the offending lines to satisfy the compiler.
I removed the 3rd argument, also on line 119
This I modified as per https://github.com/kaistseo/UnitySocketIO-WebSocketSharp