Answer the question
In order to leave comments, you need to log in
Why doesn't socket.io work?
Connecting socket.io on the service side goes like this:
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);
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question