Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update README.md #586

Closed
wants to merge 1 commit into from

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
Commits on Nov 15, 2013
  1. @alejandrolechuga

    Update README.md

    alejandrolechuga authored
    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(){});
      });
    ```
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  README.md
View
2  README.md
@@ -41,7 +41,7 @@
Add `socket.io-client` to your `package.json` and then:
```js
- var socket = require('socket.io-client')('http://localhost');
+ var socket = require('socket.io-client').connect('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', fucntion(){});
Something went wrong with that request. Please try again.