G
G
gachkydxvbgd2018-07-01 00:09:39
Nginx
gachkydxvbgd, 2018-07-01 00:09:39

Why is it not connecting to wss?

nginx

server {
    charset utf-8;
    client_max_body_size 128M;
    listen 80;
    listen 443 default ssl;
    ssl_certificate         /etc/nginx/ssl/cert.pem;
    ssl_certificate_key     /etc/nginx/ssl/cert.key;
    server_name url;

nodejs
const https = require('https'),
    fs = require('fs'),
    WebSocket = require('ws'),
    server = https.createServer({
     ssl: true,
                 cert: fs.readFileSync('/etc/nginx/ssl/cert.pem'),
                 key: fs.readFileSync('/etc/nginx/ssl/cert.key'),
                 port: 2052,
}),

nginx is under cloudflare
Gives an error Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-07-01
@ky0

Decide if you have this server for HTTP or HTTPS.
For nginx, encryption, IMHO, is superfluous.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question