-

   rss_forum_sources_ru

 - e-mail

 

 -

 LiveInternet.ru:
: 29.07.2007
:
:
: 80

:


HTML + NodeJs

, 09 2021 . 05:33 +
diel:

:

    var app = require('express')();
    var http = require('http').Server(app);
    var io = require('socket.io')(http);
    app.get('/', function(req, res) {
    res.sendFile("index.html");
    });
    io.on('connection', function(socket) {
    console.log('A user connected');
    function myFunc(arg)
    {
    var rnd = Math.random();
    socket.emit("message", "

    " + arg + " " + rnd + "

    ");
    }
    setInterval(myFunc, 1500, 'funky');
    socket.on('event', function (data) {
    console.log("" + data.my);
    });
    socket.on('disconnect', function()
    {
    console.log('A user disconnected');
    });
    });
    http.listen(3000, function() {
    console.log('listening on *:3000');
    });


:



. , php , .
NodeJS?
, .

, .

https://forum.sources.ru/index.php?showtopic=421444&view=findpost&p=3847281

:  

: [1] []
 

:
: 

: ( )

:

  URL