Socket Io Client sent messages are not received at the Node Js server.

Here is the client inside Game Engine… I’m using the following library for this.

Socket io

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using SocketIO;

public class Communication : MonoBehaviour {
	public GameObject go;
	SocketIOComponent socket;
	Dictionary<string, string> data;    
	void Start () {
        go = GameObject.Find("SocketIO");
        socket = go.GetComponent<SocketIOComponent>();
        data = new Dictionary<string, string>();
        data["email"] = "";
		data["pass"] = "1234";		
        socket.Emit("messages", new JSONObject(data));

Following is the server that I’m running inside my PC. (Outside Unity)

var app = require('express')();
var http = require('http').Server(app);
var io = require('')(http);

app.get('/', function(req, res){
    res.send('<h1>Hello world</h1>')

io.on('connection', function(socket){
    console.log('a user connected');

    socket.on('disconnect',function () {
        console.log('User Disconnected...')

    socket.on('messages',function (msg) {


http.listen(80, function(){
    console.log('listening on *:80');

Client connects to the server but it doesn’t print out the received message. Actually, the following line doesn’t print either.


Even in the client, following line prints nothing on the console.


Am I doing something wrong? Any help is much appreciated.

Hi still need a hand ???


  • Because the package work well in the past so what you need is get in the time machine.
  • Or … you can uninstall the SocketIO on your node server and reinstall the older version

i delete version 3, re-install version 2.1.1 and it’s work

cd YourServerPath

npm uninstall

npm install

You guys are wellcome :Đ