M
M
Mark Adams2018-09-13 18:26:35
JavaScript
Mark Adams, 2018-09-13 18:26:35

How to connect to Heroku custom domain via socket.io?

There is a design:

//client.js

var io = require('socket.io-client');

var socket = io.connect('https://app.herokuapp.com', {reconnect: true});

// Add a connect listener
socket.on('connect', function (data) {
    console.log('Connected!');
});


But for some reason, when linking a custom domain (the domain is normally linked and the heroku instance is paid), the connection does not occur:

//client.js

var io = require('socket.io-client');

var socket = io.connect('https://app.com', {reconnect: true});

// Add a connect listener
socket.on('connect', function (data) {
    console.log('Connected!');
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mark Adams, 2018-09-13
@ilyakmet

The question is closed, everything worked by itself. Apparently, there was something with DNS.

B
Boris Korobkov, 2018-09-13
@BorisKorobkov

1. Does https://app.com belong to you?
2. Specify your address in the browser (or curl, wget, etc.) (do not forget about the port) and check for yourself what is wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question