Skip to content

Failed to load resource #20

Description

@josefrm

Hello there I'm working with:

Ubutu 14.04
Express 4.10.2
Socket.io 1.3.7

Vagrant
Port fowarding :8001 to Box :80
Port fowarding :8002 to Box :3000

This is my App.js

var express = require('express');
var app = express();
var server = app.listen(3000);

var io = require('socket.io').listen(server);
var http = require('http');

io.on('connection', function(socket){
console.log('a user connected');
socket.on('disconnect', function(){
console.log('user disconnected');
});
});

and this is my index.html

<!doctype html>

<title>Socket.IO chat</title> <style> \* { margin: 0; padding: 0; box-sizing: border-box; } body { font: 13px Helvetica, Arial; } form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; } form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; } form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; } #messages { list-style-type: none; margin: 0; padding: 0; } #messages li { padding: 5px 10px; } #messages li:nth-child(odd) { background: #eee; } </style>
    Send <script src="https://cdn.socket.io/socket.io-1.3.7.js"></script> <script src="http://code.jquery.com/jquery-1.11.1.js"></script> <script> var socket = io.connect(); </script>

    then when I open in the browser the index page I get:

    Failed to load resource: the server responded with a status of 404 (Not Found)
    http://127.0.0.1:8001/socket.io/?EIO=3&transport=polling&t=1451934295598-10

    any idea how to solve it?

    Activity

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions