title: How to bind the event handler of socket.io (in nodejs) to my own scope?
body: <p>I'm using "socket.io" in my nodejs server. Is there a way to run the registered event functions in the scope of my class/module (in the browser)?</p>
  
  <pre><code>...
  init: function() {
    this.socket = new io.Socket('localhost:3000'); //connect to localhost presently
    this.socket.on('connect', this.myConnect);
  },
  myConnect: function() {
    // "this.socket" and "this.f" are unknown
    // this.socket.send({});
    // this.f();
  },
  f: function() {
    // ...
  }
  ...
  </code></pre>