Skip to content

Update README.md#586

Closed
alejandrolechuga wants to merge 1 commit intosocketio:masterfrom
alejandrolechuga:patch-2
Closed

Update README.md#586
alejandrolechuga wants to merge 1 commit intosocketio:masterfrom
alejandrolechuga:patch-2

Conversation

@alejandrolechuga
Copy link

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(){});
  });

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(){});
  });
```
@alejandrolechuga
Copy link
Author

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 pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant