简体   繁体   English

使用SSL的node.js和socket.io

[英]node.js and socket.io with SSL

I have a server with fully working wildcard SSL, but socket.io give me error: 我有一台具有完全可用的通配符SSL的服务器,但是socket.io给我错误:

Failed to load resource: net::ERR_CONNECTION_CLOSED 无法加载资源:net :: ERR_CONNECTION_CLOSED

On the client side im connecting to the socket like that: 在客户端上,即时通讯这样连接到套接字:

var socket = io.connect('http://pricer.somedomain.com',{secure: true, port:5005});

Server Side: 服务器端:

var io                      = require('socket.io').listen(5005);

What am i doing wrong? 我究竟做错了什么?

Your client need to connect through https://, not http:// 您的客户需要通过https://而不是http://进行连接

var socket = io.connect('https://pricer.somedomain.com',{secure: true, port:5005});

I had the same problem yesterday, check on my topic . 昨天我遇到了同样的问题,请检查我的话题

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

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