Nodejs Server is listening but client doesn't reach server

My domain is:

My web server is (include version): apache2@latest

The operating system my web server runs on is (include version): Ubuntu@latest

My hosting provider, if applicable, is: OVH

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 2.4.0

I am scratching my head because I do not understand how to fix this problem. This is only happening with this one server. All other nodejs + servers are running properly and have the same configuration. I'm running a website with apache2 and created a server with nodejs + I've installed all the modules and when I run sudo pm2 start server this is what I see respectively :

enter image description here

As you can see Node is listening and when I run this command sudo ss -ltnp I see that the port is open.
I'm troubleshooting with the documentation here. I tried everything and I am lost. All my other servers with similar configuration all work. But this one is unreachable and I have no clue whats blocking the connection. When I paste this link in the browser it takes forever to load.

Errors I get in the console (Network tab) :

the connection used to fetch this resource is not secure

I reinstalled and reconfigure my server for the third time in a row now. I've deployed over 100 servers in my engineer career and this has never happened to me. There is something wrong with the letsencrypt certificate but I don't know where to look to solve this. I am using certbot. Any insights regarding this issue would help. I'm on a tight deadline.


const express = require('express');
const app = express();
const https = require('https');

var options = {
key: fs.readFileSync('/etc/letsencrypt/live/'),
cert: fs.readFileSync('/etc/letsencrypt/live/')

var server = https.createServer(options, app);

const io = require('')(server, {
cors: {
origin: '*',
methods: ["GET", "POST"],
allowedHeaders: ["my-custom-header"],
credentials: true

io.on('connection', (socket) => {

var socketid =;//my socket id

//console socket connect
console.log('[][new user connected] : ' + socketid);

server.listen(3008, () => {

console.log('[][Node listening on *:3008');



var socket = io.connect('', {'multiplex': false});

<!--do stuff here-->


<script src=""></script>

Highly unlikely that is true or the cause. I can't even connect to your domain/port so the TLS handshake has not even begun. Looks like a comms routing problem or firewall. You are using the Cloudflare CDN. Likely routing problem between it and your origin server.

For IPv6

curl -i -m10 -vvv
*   Trying 2606:4700:3034::ac43:8626:3008...
*   Trying
* After 4995ms connect time, move on!
* connect to 2606:4700:3034::ac43:8626 port 3008 failed: Connection timed out
*   Trying 2606:4700:3036::6815:60d:3008...
* After 2396ms connect time, move on!
* connect to 2606:4700:3036::6815:60d port 3008 failed: Connection timed out
* Connection timed out after 10000 milliseconds
* Closing connection 0
curl: (28) Connection timed out after 10000 milliseconds

For IPv4

curl -i4 -m10 -vvv
*   Trying
* After 5000ms connect time, move on!
* connect to port 3008 failed: Connection timed out
*   Trying
* After 2499ms connect time, move on!
* connect to port 3008 failed: Connection timed out
* Failed to connect to port 3008 after 7503 ms: Connection timed out
* Closing connection 0
curl: (28) Failed to connect to port 3008 after 7503 ms: Connection timed out

Oh, I just remembered that Cloudflare CDN does not support all port numbers.

You should review their docs about that


Thank you for trying to help. Cloudflare is set to Full and it should be working fine with certbot. When you're talking about Origin Server, should I use the Cloudflare certificates instead of letsencrypt?

1 Like

You can if you wish but see my post #3 about more likely problem


I've always used certbot and letsencrypt without issue. I'd rather continue with my current setup. What do you suggest I do about this communication problem? This TLS/firewall thing is a little outside of my scope but I'm a fast learner if you can guide me.

I don't think you can use port 3008 with Cloudflare CDN. But, you should check with those docs or visit the Cloudflare Community. This has nothing to do with certs.

You might try not proxying your DNS in Cloudflare


Yes I can lol. I'm using another server same setup and I'm able to do polling. It has nothing to do with ports. I'm using 3006 and 3008 in another project on a different IP and it runs just fine. I know its letsencrypt because those other servers running nodejs + socketio were setup with certbot last year or before you guys changed something and they are working fine. This new server was setup this year and it's the only one not working. So there's certainly a correlation with your new configuration.

Information like these is not very useful; As it can mean different things to different people.

It is always best to provide actual version numbers [and letters (if any)].


Can you give domain name?

Is that proxied in Cloudflare too?


Also behind Cloudflare?
[you must compare apples to apples]


Yes. They all follow same kind of configuration.

Please share a domain name that is working on one of those ports. A second set of eyes may see something you don't


All my websites and apps run through cloudflare and have same configuration on apache2

I would have to see that to believe it. The evidence I showed says otherwise.


How did you set that up [within Clloudflare]?


Sorry for late answer. I had to go through some things first. The other domain : and you can check polling working just fine here :

This is our oldest product and as you can see, everything running A1 and like I said, it is same nodejs + socketio+ certbot(letsencrypt) setup as our domain. All running through cloudflare. All is pointing to letsencrypt.

The domain is NOT using Cloudflare CDN. Huge difference


compare to


Address: 2606:4700:3034::ac43:8626
Address: 2606:4700:3036::6815:60d

Bro... please stop insulting my intelligence and my works. Who do you think this is? A human?