I have made a node server with with express and sockets io. It is a simple chat application that would be an addon, to my existing project on my website.
I am having this issue where I am unable to connect to the server from the client to be able to use the chat application.
Error: polling-xhr.js:202 GET https://128.127.106.17:6379/socket.io/?EIO=4&transport=polling&t=Nixndgr net::ERR_CONNECTION_TIMED_OUT
SERVER
const fs = require("fs");
const path = require('path');
const express = require('express');
const app = express();
const http = require('http');
const options = {
key: fs.readFileSync(PATH_TO_KEY),
cert: fs.readFileSync(PATH_TO_CERT),
}
const server = http.createServer(app);
const cookie = require('cookie');
const { Server } = require("socket.io");
const io = new Server(server);
CLIENT
var socket = io(HOSTNAME, {'transports': ['websocket', 'polling']});
With these settings it works perfectly fine on my local environment, but with the actually website I have trouble getting it connected.
The few things I have attempted I tried adding the ssl options , "const server = http.createServer(options, app);"
I played around with CORS as well and different settings.
Found this https://docs.cpanel.net/knowledge-base/web-services/how-to-install-a-node.js-application/
And I found that the server was running and I would get the hello world but still not able to connect to it and starting to get stumped and running out of resources/possible solutions.