Hi!
I’ve recently deployed my app here on Glitch. However, I can’t seem to get the PeerJS or the Socket.io part of it to work.
In my script.js I have this code
const myPeer = new Peer(undefined, { host: 'justflores-kff-2.glitch.me', port: '3001' })
and on my server.js I have
io.on('connection', socket =>
socket.on('join-room', (roomId, userId) => {
socket.join(roomId)
socket.to(roomId).broadcast.emit('user-connected', userId)
socket.on('disconnect', () =>{
socket.to(roomId).broadcast.emit('user-disconnected', userId)
})
})
})
There should be a Client Connected/ Disconnected message whenever a user enters a room with the same parameter in the URL, but I’m not getting any on the Glitch terminal.
I would appreciate any help this can get. Thanks!