title: socket.io-client object is not a function
body: <p>I opened a question here earlier (<a href="https://stackoverflow.com/questions/27953338/socket-io-trigger-events-between-two-node-js-apps">Socket.io trigger events between two node.js apps?</a>), this was much help, but I am confused out of my mind.</p>
  
  <p>I keep getting object is not a function on my client side script. </p>
  
  <p>A little setup, I have a front end site that is served with express <code>localhost:9200</code> then I have a back end app <code>localhost:3100</code> that is also served with express and I am trying to emit events from <code>localhost:9200</code> to the socket.io server <code>localhost:3100</code></p>
  
  <p><strong>Client script for website localhost:9200</strong></p>
  
  <pre><code>// I have tried many different ways
  var socket = io('http://localhost:3100');
  var socket = io('http://localhost');
  var socket = io();
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p><em>The issue was with the above of course, because <code>io</code> in the above case for some reason was an object when it should be a function, I came across an old post which mentioned using <code>var socket = io.connect('http://localhost:3100');</code> <code>connect</code> and that worked, I though it was depreciated or something, I have no clue why the docs don't mention this but it fixed my issue.</em></p>
  
  <p>All result in object is not a function. I include the client side script like this</p>
  
  <pre><code>// tried some different ways
  &lt;script src="http://localhost:3100/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script src="socket.io/socket.io.js"&gt;&lt;/script&gt; // this is a 404
  </code></pre>
  
  <p>I have installed <a href="https://github.com/automattic/socket.io-client" rel="nofollow noreferrer">https://github.com/automattic/socket.io-client</a> and on the server for the front end website :9200 I have set it up like.</p>
  
  <pre><code>// tried a couple ways to connect
  var socket = require('socket.io-client')('http://localhost:3100');
  var socket = require('socket.io-client')('http://localhost');
    socket.on('connect', function(){});
    socket.on('event', function(data){});
    socket.on('disconnect', function(){});
  </code></pre>
  
  <p>I am confused on how to properly configure this so that I can get my site to emit socket events to my server and visa versa?</p>