title: Socket Failed to load resource server (404 error)
body: <p>hey guys m using to files for server side server.js and at client side using javascript </p>
  
  <p><strong><em>server.js</em></strong></p>
  
  <pre><code>var express = require("express");
  var io = require("socket.io").listen(app);
  var app = express.createServer("localhost");
  app.listen(3000);
  
  
  app.get('/', function (req, res) {
      res.sendfile(__dirname + '/hello.html');
  });
  
      console.log("before");
      io.sockets.on("connection", function (socket) {
          console.log("after");
          socket.on("message send", function (data) {
              io.sockets.emit("new mesage", data);
          });
      });
  </code></pre>
  
  <p>and at client side using one html page name </p>
  
  <p><strong><em>hello.html</em></strong> </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;style&gt;
          #chat{
          height : 500px;
          }
  
      &lt;/style&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="chat" &gt; &lt;/div&gt;
      &lt;form id ="send message"&gt; 
          &lt;input id="message" type="text" &gt;&lt;/input&gt;
          &lt;input type="submit"&gt;&lt;/input&gt;
      &lt;/form&gt;
      &lt;script type= "javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
      &lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
      jQuery(function($){
          var socket =io.connect();
          var $messageForm = $("#send message");
          var $messageBox=$("#message");
          var $chat = $("#chat");
  
              $messageForm.submit(function(e){
                  e.preventDefault();
                  socket.emit("message send" , $messageBox.val());
              });
              socket.on("new message", function(data){
                  $chat.append(data + "&lt;/br&gt;");   
              });
      });
      &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>when m start server then its proporly working but when i sent a request then it shows <strong><em>error</em></strong> like given blow</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 404 (Not Found) /socket.io/socket.io.js</p>
    
    <p>Uncaught ReferenceError: jQuery is not defined</p>
  </blockquote>
  
  <p>versions</p>
  
  <p><strong>socket.io:0.9.16</strong></p>
  
  <p><strong>exparess:3.4.0</strong></p>
  
  <p>thanks for your time :)</p>