Answers for "io.socket:socket.io-client"

2

socket io script

<script src="/socket.io/socket.io.js"></script>
<script>
  const socket = io();
</script>
Posted by: Guest on August-29-2020
2

import socket io frontend

<script src="/socket.io/socket.io.js"></script><script>  const socket = io('http://localhost');</script>
Posted by: Guest on August-09-2020
3

socket..io

<script src="https://cdn.socket.io/socket.io-3.0.1.min.js"></script>
Posted by: Guest on November-24-2020
3

socket io

npm install --save socket.io
Posted by: Guest on December-01-2019
1

socket io

It is a library that enables real-time, bidirectional and event-based communication between the browser and the server.
Posted by: Guest on July-03-2021
0

socket io

//Importamos la app
const app = require('./app');

const socketIO = require('socket.io');

//Con el modulo 'dotenv' importamos las variables de entorno
//contenidas dentro del archivo '.env'
//Se recomienda correr este proyecto con permisos de administrador
require('dotenv').config();

//Importamos la conexion a la base de datos dentro de 'database.js'
require('./database/database');

//Esta funcion ejecuta el servidor
async function main(){


    //Obtenemos el puerto
    const PORT = app.get('port');  

    //Escuchamos el servidor en puerto y con '0.0.0.0' podemos acceder publicamente
    server = await app.listen(PORT, '0.0.0.0');

    
    const io=socketIO.listen(server);

    //console.log('io index: ', io)

    /*
    io.on('connection', function(){
        console.log('Socket Conectado');
        io.emit('Prueba', 'Hola soy el servidor'.toString());
    });
    */
    
    
    //Mostramos por consola
    console.log('Servidor ejecutandose en el puerto: ', PORT);

> };

main();
Posted by: Guest on September-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language