Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net::ERR_CONNECTION_REFUSED #1267

Closed
robbietorinit opened this issue Jan 24, 2019 · 3 comments
Closed

net::ERR_CONNECTION_REFUSED #1267

robbietorinit opened this issue Jan 24, 2019 · 3 comments

Comments

@robbietorinit
Copy link

I have my code like this for socket.js

var app = require('express')();
var fs = require('fs');
// var http = require('http').Server(app);

var https = require('https');
var server = https.createServer({
    key: fs.readFileSync('/home/ubuntu/config/key.key'),
    cert: fs.readFileSync('/home/ubuntu/config/key.crt'),
    ca: fs.readFileSync('/home/ubuntu/config/godaddy.crt'),
    // requestCert: true,
    rejectUnauthorized: true
}, app);

var io = require('socket.io')(server);
app.get('/', function(req, res){
  res.sendfile('index.html');
});
var Redis = require('ioredis');
var redis = new Redis();
redis.psubscribe('*', function(err, count) {
});

server.listen(3000, function() {
    console.log('Listening on Port 3000');
});

and my client code is as below:

<script src="{{ url('js/socket.io.js') }}"></script>
    <script>
      var socket = io.connect('https://domain.com:3000', {
        secure: true
      });

      socket.on('message', function(data) {
        alert(data);
      });
    </script>

When I run the sever using node socket.js and try to visit the site it shows connection refused for the polling calls and also when i see the server like domain.com:3000 it says connection refused.

Can someone please help me at earliest??

@Oscarz90
Copy link

is there a solution for this issue????

@robbietorinit
Copy link
Author

Check your firewall buddy!!

@darrachequesne
Copy link
Member

Closed due to inactivity, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants