Support the ongoing development of Laravel.io →
Installation Configuration
Last updated 2 years ago.
0

What runs perfectly well locally in homestead does not seem to be right for forge.

node -v
v0.10.37
npm -v
1.4.28

my socket.js

    var app = require('express')();
    var server = require('http').Server(app);
    var io = require('socket.io')(server);
    var redis = require('redis');
     
    server.listen(3000, function(){
        console.log('Listening on Port 3000');
    });

    io.on('connection', function (socket) {
     
      console.log("new client connected");
      var redisClient = redis.createClient();
      redisClient.subscribe('message');
     
      redisClient.on("message", function(channel, message) {
        console.log("mew message in queue "+ message + "channel");
        socket.emit(channel, message);
      });
     
      socket.on('disconnect', function() {
        redisClient.quit();
      });
     
    });

I guess it has to do with paths, while

node socket.js 

works in homestead, on my envoyer/forge I have to do

current/socket.js 

to start the server, but on the channel connection I get

GET https://mydomain.com:3000/socket.io/?EIO=3&transport=polling&t=1432220793670-25 net::ERR_CONNECTION_TIMED_OUT 
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

pbohny pbohny Joined 12 Mar 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.