UnitySocketIO
UnitySocketIO copied to clipboard
Error initializing handshake with local url.
When I tried create a new socket by doing same as how API done,It cames: Here is my code ,just same as api:https://github.com/NetEase/UnitySocketIO
void Start () {
string url = "http://192.168.199.128:5500";
client = new Client(url);
client.Opened += SocketOpened;
client.Message += SocketMessage;
client.SocketConnectionClosed += SocketConnectionClosed;
client.Error += SocketError;
client.Connect();
}
private void SocketError(object sender, ErrorEventArgs e)
{
Debug.Log(e.Message);
}
private void SocketConnectionClosed(object sender, EventArgs e)
{
Debug.Log(e);
}
private void SocketMessage(object sender, MessageEventArgs e)
{
Debug.Log(e.Message);
}
private void SocketOpened(object sender, EventArgs e)
{
Debug.Log("Socket Connected!");
}
My Server is running at a VMWare machine.
And the Unity print:
Could you help?Thanks!
having the same problem. @chilzyj did you find a solution to this?
I'm also having this problem. @chilzyj @mhle did either of you find a solution?
What's weird is I clearly see in my server console it connects, but it still errors.
void Start () { string url = "http://192.168.199.128:5500"; client = new Client(url); ...... }
change to
string url = "http://192.168.199.128:5500"; client = new Client(url); void Start () {
...... }
@chilzyj @mhle @boynedmaster hi guys, did you find a solution?
Wich version of pomelo are you using? Socket.io is very version dependent, and the problem could be there. I'm asking for any solution or client update in: https://github.com/NetEase/UnitySocketIO/issues/33
And there is a similar issue: https://github.com/NetEase/UnitySocketIO/issues/35
@FrancooHM Sorry, I don't think I did. I just went with WebSocketSharp and ditched Socket.IO. It seems that the comment above you offers a solution, I haven't tried it.
Thanks for your quick response @boynedmaster. You still using pomelo for WebSocketSharp? Wich version of both?
I don't know what pomelo is, sorry.
Oh, sorry i mixed up with another WebSockets lib of NetEase, and Pomelo is a GameServer of NetEase. What kind of solution did you implemented server side @boynedmaster ?
I ended up just using a basic WebSocket server if I remember correctly @FrancooHM.
@chilzyj 一样的问题,大佬可知道解决的办法
you need to use socket.io v0.9 to connect to UnitySocketIO