Update README.md #586

Closed
wants to merge 1 commit into
from

Projects

None yet

1 participant

@alejandrolechuga

I'm not sure about the other code examples but NodeJS didn't work with that code so I added the ".connect" and now works just as expected

  var socket = require('socket.io-client').connect('http://localhost');
  socket.on('connect', function(){
    socket.on('event', function(data){});
    socket.on('disconnect', fucntion(){});
  });
@alejandrolechuga alejandrolechuga Update README.md
I'm not sure about the other code examples but NodeJS didn't work with that code so I added the ".connect" 

```js
  var socket = require('socket.io-client').connect('http://localhost');
  socket.on('connect', function(){
    socket.on('event', function(data){});
    socket.on('disconnect', fucntion(){});
  });
```
dc0f6bc
@alejandrolechuga

I was getting this error

/Users/javascripter/socket-server/server.js:29
var socket = require('socket.io-client')('http://192.168.0.11:8080');
^
TypeError: object is not a function
at Object. (/Users/javascripter/socket-server/server.js:29:41)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment