简体   繁体   中英

Socket.io connecting to another Domain error


Im currently running my own website using socket.io in nodejs.
My problem was that Im using cloudflare and all opened ports were already in use so I decided to buy an additional IP address to my current VPS.

Now I need to connect the socket.io connection to a different sub domain which redirect to my additional IP address.
The sub domain is already connected to the ip and the ip successfully redirect to the domain.

Im connecting my socket connection like this:

server.listen(socket_port, 'https://sub.my-domain.com');

sub.my-domain is my actual sub-domain.

Now when Im starting my nodejs app Im getting that error:

Error: getaddrinfo ENOTFOUND https://sub.my-domain.com
Anyone know why Im getting this and is able to help?

Thanks in advice!

The error appears to be Error: getaddrinfo ENOTFOUND https://sub.my-domain.com . I would suggest you to try to put an IP address instead of https://sub.my-domain.com or try only sub.my-domain.com or something like http://sub.my-domain.com . Obviously the server can't connect to the domain address you have specified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM