i am having the same problem, i am running on windows
Jul 7, 2017
3
Level 3
Socket is not connecting to 192.168.10.10:3000 using homestead and laravel and socket.io
From the server side everything is working fine:
var server = require('http').Server();
var io = require('socket.io')(server);
var Redis = require('ioredis');
var redis = new Redis();
redis.subscribe('test-channel');
redis.on('message', function (channel, message) {
message = JSON.parse(message);
console.log(channel + ':' + message.event);
io.emit(channel + ':' + message.event, message);
});
/*Booting Up the Server : port 3000 */
server.listen(3000 , function(){
console.log('The Server Is Running');
});
Only on the client side it is not working.
$(document).ready(function(){
var socket = io.connect('http://192.168.10.10:3000');
console.log(socket.connected);
socket.on('test-channel:UserSignedUp', function(data) {
console.log(data);
});
});
The console.log('socket.connected) return false all the time.
I followed this series: https://laracasts.com/series/real-time-laravel-with-socket-io/episodes/3?autoplay=true
How can i debug this? What am i doing wrong?
Thanks.
Please or to participate in this conversation.