I have created a API
that uses socket.io
:
const socketIo = require('socket.io');
const serverHttps = https.createServer(httpsOptions,
app).listen(httpsPort, () => {
console.log('HTTPS: Server running at ' +
httpsPort)});
const io = socketIo(serverHttps);
io.on('connection', (socket)=> {
socket.emit('hello', { greeting: 'Hola
George'});
});
And this API
consumption from Angular
where I have also implemented socket.io.
When you start in the method ngOnInit
to connect to API
through socket:
import * as socketIo from 'socket.io';
const socket = socketIo('https://192.168.120.201:8950');
I'm getting this error
WARNING in ./node_modules/socket.io/lib/index.js 108: 11-32 Critical dependency: the request of a dependency is an expression
Any idea what it might be?
Do I need to install another library?