You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
574 B
22 lines
574 B
//const io = require('socket.io')('http://localhost:3000');
|
|
const http = require('http');
|
|
const io = require('socket.io')('http://82.165.180.114:3000');
|
|
|
|
const server = http.createServer((req,res) => {
|
|
res.end('Création du serveur');
|
|
});
|
|
|
|
const socketServer = io(server);
|
|
|
|
socketServer.on('connection', socket => {
|
|
console.log("connection de l'utilisateur à l'id ". socket.id);
|
|
})
|
|
|
|
socketServer.on('launchGame') , function () {
|
|
console.log('launch the game');
|
|
location.reload();
|
|
}
|
|
|
|
io.listen(3000, () => {
|
|
console.log('app listening on port 3000')
|
|
}); |