JavaScript Hosting Socket.io Server over LAN hosting socket server,websocket server hosting,hosting socket server c#

I'm building Socket.IO's example chat project (with some modifications) and I've been trying to get people to connect with both localhost:3000 and 127.0.0.1:3000, but neither are working. Am I missing something? (If there's a blatantly obvious problem, sorry. I suck with networking.)

index.js:

var app=require('express')();
var http=require('http').Server(app);
var io=require('socket.io')(http);
var chalk=require('chalk');

var online=0;
var prt=process.argv[2]===undefined?3000:process.argv[2];

process.stdin.on('data',function(){
    var str=String(process.stdin.read());
    if(str.search("!quit")){
        io.emit('chat message','Console: stopping server.');
        process.exit();
    }
});

app.get('/',function(req,res){
    res.sendFile(__dirname+'/index.html');
});

io.on('connection',function(socket){
    online++;
    console.log(chalk.green('joined  |',chalk.cyan(online),'online'));

    socket.on('chat message',function(msg){
        io.emit('chat message',msg);
        console.log(chalk.magenta('message |',msg));
    });

    socket.on('disconnect',function(){
        online--;
        console.log(chalk.red('left    |',chalk.cyan(online),'online'));
    });
});

http.listen(prt,function(){
    console.log(chalk.yellow('SIOChat listening on',chalk.cyan(prt)));
});

index.html (omitted css for readability):

<html>
    <head>
        <title>SIOChat</title>
    </head>
    <body>
        <ul id='messages'></ul>
        <form action=''>
            <input id='m' autocomplete='off'/><button>Send</button>
        </form>
        <script src='https://cdn.socket.io/socket.io-1.2.0.js'></script>
        <script src='http://code.jquery.com/jquery-1.11.1.js'></script>
        <script>
            var socket=io();

            var name=prompt('Enter a nickname','Guest');

            $('form').submit(function(){
                socket.emit('chat message',name+': '+$('#m').val());
                $('#m').val('');
                return false;
            });

            socket.on('chat message',function(msg){
                $('#messages').append($('<li>').text(msg));
            });
        </script>
    </body>
</html>
Answer:1

I am using jQuery UI for information display on desktops in tabs and have so for some time. I have added Responsive Tabs to Accordion to show the same information in accordion tabs for tablets and ...

I am using jQuery UI for information display on desktops in tabs and have so for some time. I have added Responsive Tabs to Accordion to show the same information in accordion tabs for tablets and ...

  1. jquery accordion tabs example
  2. jquery accordion tabs
  3. jquery accordion tab click event
  4. jquery accordion tab menu
  5. jquery tabs accordion responsive
  6. jquery accordion inside tabs
  7. jquery hide accordion tab
  8. jquery accordion select tab
  9. jquery accordion active tab
  10. jquery accordion open tab
  11. jquery accordion close tab
  12. jquery accordion first tab open
  13. jquery accordion remove tab
  14. jquery accordion disable tab
  15. jquery ui tabs accordion responsive
  16. jquery accordion close all tabs
  17. jquery accordion open all tabs
  18. accordion tabs jquery free download
  19. jquery ui accordion inside tabs
  20. jquery ui accordion in tabs

I am attempting to disable a button using an external JavaScript - activated by a submit button <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

I am attempting to disable a button using an external JavaScript - activated by a submit button <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

I'm new to HTML (just started learning at school) and I have a small question about classes and the ability to filter them. Basicially, I'm working on a page of football fixtures, which will look as ...

I'm new to HTML (just started learning at school) and I have a small question about classes and the ability to filter them. Basicially, I'm working on a page of football fixtures, which will look as ...

  1. create html class in javascript
  2. create html class
  3. create class html css
  4. js create html class
  5. create html helper class in mvc
  6. create html element with class javascript
  7. html create element class
  8. html create style class
  9. create div class html
  10. create new class html
  11. create custom class html
  12. html create dynamic class
  13. html create paragraph class
  14. html create pseudo-class
  15. html create element add class
  16. html create element set class

So, I'm not sure if I should've structured my app different or if I'm doing something fundamentally wrong. I'm a bit confused, but let's explain first things first. In the first navigation level, ...

So, I'm not sure if I should've structured my app different or if I'm doing something fundamentally wrong. I'm a bit confused, but let's explain first things first. In the first navigation level, ...