Closed Tidominer closed 2 years ago
Hi. I imported this package to my unity project, created an empty object and gave 'Test Object' script to it. then created a server and used the code in this package for the server(I initialized a node J s program, installed express , socket.io and nodemon ) I also created a html file which has a text inside "Server is Running" in the server directory named that "index.html". Now when I start the server, and enter this URL in a browser "http://127.0.0.1:1010" , I can see that "Server is running" message, but in unity ,when I run the game nothing happens. I can see "start" message in console but I cant see "connected" message which means it cant connect to the server. I also tried it on a new project, different ports ,localhost instead of 127.0.0.1, but didn't work. Do you know what is the problem? Thanks
Try to change server Socket.io version to 2.0.1, if you have another one
@kirabee08 making sure that nodejs socket.io is 2.0.1 fixed the unity connection problem for me. However, now, I cannot connect from the web browser socket.io client version 3.1.0. Can you suggest which npm socket.io-client will work with socket.io 2.0.1? Thanks.
Thank you, It solved my problem!
Hi. I imported this package to my unity project, created an empty object and gave 'Test Object' script to it. then created a server and used the code in this package for the server(I initialized a node J s program, installed express , socket.io and nodemon ) I also created a html file which has a text inside "Server is Running" in the server directory named that "index.html". Now when I start the server, and enter this URL in a browser "http://127.0.0.1:1010" , I can see that "Server is running" message, but in unity ,when I run the game nothing happens. I can see "start" message in console but I cant see "connected" message which means it cant connect to the server. I also tried it on a new project, different ports ,localhost instead of 127.0.0.1, but didn't work. Do you know what is the problem? Thanks