Подключение socket.io на стороне сервиса идёт так:
var auth = require('http-auth'),
scribe = require('scribe-js')(),
console = process.console,
config = require('./config.js'),
app = require('express')(),
server = require('http').Server(app),
io = require('socket.io')(server),
fs = require('fs'),
//privateKey = fs.readFileSync('/etc/letsencrypt/live/' + config.domain + '/privkey.pem'),
//certificate = fs.readFileSync('/etc/letsencrypt/live/' + config.domain + '/cert.pem'),
//credentials = {key: privateKey, cert: certificate},
//http = require('http').Server(credentials,app);
http = require('http').Server(app);
redis = require('redis'),
requestify = require('requestify');
var redisClient = redis.createClient(),
client = redis.createClient();
server.listen(config.serverPort);
console.tag('SOCKET', logTime()).log('Сервер запущен на ' + config.domain + ':' + config.serverPort);
А в js сайта указано:
if (START) {
var socket = io.connect(':2053');
var CurrentPage = document.location.pathname;
socket
Но консоль сайта ругается:
GET https://site:2053/socket.io/?EIO=3&transport=polling&t=MoQ3aKg net::ERR_FAILED
(index):1 Access to XMLHttpRequest at 'https://site:2053/socket.io/?EIO=3&transport=polling&t=MoQ3a_
GET https://site:2053/socket.io/?EIO=3&transport=polling&t=MoQ3a_B net::ERR_FAILED
В чём может быть проблема?