kaistseo / unitysocketio-websocketsharp Goto Github PK
View Code? Open in Web Editor NEWUnitySocketIO using websocket-sharp instead of WebSocket4Net
UnitySocketIO using websocket-sharp instead of WebSocket4Net
Hey,
When using socket.io at the back-end, i receive this error whenever i try to connect, and afterwards it closes the connection.
DEBUG - "destroying non-socket.io upgrade"
Hi !
Tks a lot for this library. I encounter those errors when I switch my project build settings to "webplayer" :
Assets/SocketIO/websocket-sharp/Ext.cs(88,81): error CS1729: The type System.IO.Compression.DeflateStream' does not contain a constructor that takes 3' arguments
Assets/SocketIO/websocket-sharp/Ext.cs(125,83): error CS1729: The type System.IO.Compression.DeflateStream' does not contain a constructor that takes 3' arguments
Assets/SocketIO/websocket-sharp/Net/HttpConnection.cs(115,43): error CS1061: Type WebSocketSharp.Net.Security.SslStream' does not contain a definition for AuthenticateAsServer' and no extension method AuthenticateAsServer' of type WebSocketSharp.Net.Security.SslStream' could be found (are you missing a using directive or an assembly reference?)
I have no problem with Android, IOS, windows, or windows Phone.
I don't have any error in Visual Studio, and a quick checking of the DeflateStream class shows a constructor with 3 arguments ...
I suppose it's because of System.IO not being available with the webplayer. But in this case, does that mean this library does not work with the webplayer at all ?
Breaks Client.cs when trying to compile from source.
Here's a link to the commit:
sta/websocket-sharp@d632fc8#diff-247ba5074c5d14b0c26c9aebe4891247
Hi, I have problems using your library with socket.io 1.0, you have plans to upgrade your client in order to work with socket.io 1.0?.
Thanks.
Is there a way to use xhr-polling as transport mechanism instead of websocket? My server identifies the client as using websocket.
Hi how can i fixed the error below?
Assets/UnitySocketIO-WebSocketSharp-master/SocketIO/websocket-sharp/AuthenticationResponse.cs(301,16): error CS0121: The call is ambiguous between the following methods or properties: WebSocketSharp.Ext.IsNullOrEmpty(this string)' and
WebSocketSharp.Ext.IsNullOrEmpty(this string)'
So, I was trying this out today, and noticed that the issue is it wraps the object[] into another object[]. I noticed that you had already supported it in the JSONEncodedEventMessage via the constructor of JsonEncodedEventMessage(string name, object[] payloads).
However, by trying to just use the Client.Emit it sends the object[] as just an object and thus only calls the JSONEncodedEventMessage(string name, object payload).
To fix this Add the following lines to Client.cs:
public void Emit(string eventName, Object[] payloads) {
this.Emit (eventName, payloads, string.Empty, null);
}
public void Emit(string eventName, Object[] payloads, string endPoint, Action<Object> callback) {
IMessage msg = null;
if (!string.IsNullOrEmpty(endPoint) && !endPoint.StartsWith("/"))
endPoint = "/" + endPoint;
msg = new EventMessage(eventName, payloads, endPoint, callback);
if (callback != null)
this.registrationManager.AddCallBack(msg);
this.Send(msg);
}
Then in EventMessage.cs add the following:
public EventMessage(string eventName, object[] payloads, string endpoint, Action<Object> callBack) : this() {
this.Callback = callBack;
this.Endpoint = endpoint;
if (callBack != null)
this.AckId = EventMessage.NextAckID;
this.JsonEncodedMessage = new JsonEncodedEventMessage(eventName, payloads);
this.MessageText = this.Json.ToJsonString();
}
I can't seem to get UnitySocketIO to handshake with my Node.js socket.io server. You can find the details here:
http://stackoverflow.com/questions/24187480/unity3d-and-sockets-io-wont-handshake
Thanks!
when I run in Unity Editor, and connect to socket.io server, the cpu used percent jump to 100%
so, the library works in Unity for Android and WebPlayer, but when i build a WebPlayer app for chrome, it doesn't work and i only get in the console the message:
socket client error: Error initializing handshake with http://10.0.0.111:3014/
It is intended to work with the WebPlayer or is there a problem?
Hello,
I can't to connect to my server with ws://address.tld or wss://address.tld I figure out, that http://address.tld is working. So this is not a problem.
But I am not able to figure out, how to connect to server with https. I am trying to connect to heroku. With http only it working like a charm but with https (even with specific 443 port) it fails.
So my question is. Does this websocket with https?
Here is log:
socket Error: Error initializing handshake with https://itdrawing.herokuapp.com/
UnityEngine.Debug:Log(Object)
InstantiatePoints:<Start>m__2(Object, ErrorEventArgs) (at Assets/scripts/instantiater/InstantiatePoints.cs:33)
SocketIOClient.Client:OnErrorEvent(Object, ErrorEventArgs)
SocketIOClient.Client:Connect()
InstantiatePoints:Start() (at Assets/scripts/instantiater/InstantiatePoints.cs:35)
Hi @kaistseo, help me...
I have problems using your library with link https. So occur error while handshaking and 100% CPU
Hi,Will upgrade to this library (socket io 1.x)?
I cannot get this working in the webplayer. I tried by using the the example script provided. Everything works inside the unity editor (webplayer platform) but once you export it and put it live it stops working.
All I get is Error initializing handshake.
Has anyone used this with success inside the webplayer?
The original UnitySocketIO and websocketsharp are both under the MIT license but this project does not have a license attached to it. Could you consider licensing this project under the MIT license?
Hi.
I need to connect to a socket.io namespace (socket.io 0.9.x)
e.g. using JS client I would connect to http://mysocketioserver:1234/namespace
Is the correct way to do this to pass the string in the Connect() method rather than in the URL?
socket = new SocketIOClient("http://mysocketioserver:1234");
socket.Connect("namespace");
And if so, do I also need to pass it when doing an Emit?
socket.Emit("message", args, "namespace", null)
Normally I Emit a "joinRoom" message after connecting with a UID as the args and then I'm able to receive messages but not sure what I'm doing wrong here. I get the "connect" message but none of the messages I'm expecting after that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.