1、wss心跳每30秒一次,3次收不到心跳即90秒钟收不到心跳断开连接
2、nginx配置ssl访问wss配置如下
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#gzip on;
# WS server
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream wsbackend {
server 127.0.0.1:18085;
keepalive 1000;
}
server {
listen 443 ssl;
server_name localhost;
# 证书路径
ssl_certificate jerry2.pem;
ssl_certificate_key jerry2.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_pass http://wsbackend;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-R