Socket.io Not Working

Hey,

Our project uses cluster with different ip addresses and ports .I’m managing all of them using nginx proxy redirecting to “example,com” ( to the same domain ) like this:

https://i.hizliresim.com/9YVnNk.jpg
https://i.hizliresim.com/qA45v5.jpg

We changed the nameservers to the Cloudflare’s and we didn’t enable anything yet. we’re using HTTP transfer, our application’s socketio started to give us error ( a transport library - TCP ) Socketio is giving us this error:

How to solve that problem?

NOTE: It’s all about Cloudflare’s configurations. When we change back our nameservers, there’s no problem with socketio. Thanks for support.

Hi @user753, can we go through the steps you’re following?

I don’t see any an attempt to add socket.io to Cloudflare so am curious as to the process you’re following.

Going through the steps to add the zone will result in two name servers being assigned to you. Those are probably the same that are used on other zones you may have on Cloudflare. At that point, your old name servers need to be replaced with only the two that are assigned by Cloudflare for that zone. If you were using random name servers or ones associated with other zones/domains, please don’t. That will leave your zone open to take-over by bad actors.

To get started, add the zone to Cloudflare, take the name servers to your registrar and have them change them.

When i change my nameservers to Cloudflare, it causes socketio connection problem. I haven’t enabled any service in my Cloudflare. Just to confirm my account i changed nameservers. Seems like Cloudflare changing, limiting or blocking my TCP channel. Do you know?

If you only change name servers and don’t +Add zone to Cloudflare means the zone is not on Cloudflare.

What do you mean? How can i “Add Zone” ?

Login to Cloudflare, on the page showing your zones on upper right look for a +Add zone button. Select that, enter name and pick a plan. Your DNS records will be scanned and added. Then, you’ll get ns names to change your name servers at your registrar.

Yes, I’ve already done them. I made them, and what about my issue about Socketio ?

Great, what is the domain name(s) you added?

And, now that the zone is added in Cloudflare, did you change the name servers with your registrar?

Yes, i changed. I just wanna to know what happens if i connect my socket server using IP Address and port like this: 1111.111.11:3000 . So, Cloudflare cannot make anything to my socket server, huh? Because i’ll not connect with my domain anymore to my socket server. Just please answer this question and we’re done :slight_smile:

What is the domain in question? I see a domain that is set up and one that is not.

I don’t know which you are talking about.

Regarding ports, https://support.cloudflare.com/hc/en-us/articles/200169156-Which-ports-will-Cloudflare-work-with-.

Edit - some similar issues discussed here, Sockets are not working with CloudFlare (Solved by myself) · Issue #2580 · socketio/socket.io · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.