简体   繁体   English

Socket.io连接到另一个域错误

[英]Socket.io connecting to another Domain error


Im currently running my own website using socket.io in nodejs. 我目前在nodejs中使用socket.io运行自己的网站。
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. 我的问题是Im正在使用cloudflare,并且所有打开的端口都已在使用中,因此我决定为当前的VPS购买一个额外的IP地址。

Now I need to connect the socket.io connection to a different sub domain which redirect to my additional IP address. 现在,我需要将socket.io连接连接到另一个子域,该子域重定向到我的其他IP地址。
The sub domain is already connected to the ip and the ip successfully redirect to the domain. 子域已经连接到ip,并且ip成功重定向到该域。

Im connecting my socket connection like this: 我像这样连接我的套接字连接:

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

sub.my-domain is my actual sub-domain. sub.my-domain是我实际的子域。

Now when Im starting my nodejs app Im getting that error: 现在,当我启动我的nodejs应用程序时,我收到了该错误:

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 . 该错误似乎是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 . 我建议您尝试放置IP address而不是https://sub.my-domain.com或仅尝试sub.my-domain.com或类似http://sub.my-domain.com Obviously the server can't connect to the domain address you have specified. 显然,服务器无法连接到您指定的域地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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