S
S
s2sk13372017-09-06 20:08:40
JavaScript
s2sk1337, 2017-09-06 20:08:40

525 error connecting NodeJS to server?

As practice has shown ... It's better to write sockets in NodeJS. Written using the SocketIO library. I uploaded a connection to the server to the site, started the server... And in the console...

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' https://domain.com ' is therefore not allowed access. The response had HTTP status code 525. I

use CloudFlare certificate for ssl, their website says that it is better to make https requests through ports:

443
2053
2083
2087
2096
8443

Actually, that's what I did.

Server:

var 
  http_server = require("http").createServer(app).listen(2096);


Client: I also tried to run the server on https...
socket = io("https://domen.com:2096");

var 
  http_server = require("https").createServer(app).listen(2096);


Same effect. Where is the mistake? Maybe I misconfigured something...

On the local network, everything connects perfectly...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2017-09-07
@xtreme

If you refer to the knowledge base of CF , it is perfectly written in English in white:
Error 525 occurs when an attempt to establish an SSL connection between CF and your server fails. This means that you have "use Full SSL" set in your settings (this is when SSL is used not only from the client to the CF, but also from the CF to the backend) and CF cannot connect to you, because it does not expect that on the other hand the usual HTTP.
Common causes:
- Your backend does not support SNI or is not configured for it
- The encryption methods that CF accepts and that your backend can do do not match anywhere
- Your backend is not configured to accept SSL at all
As one of the methods to solve the problem - use not FullSLL, but Flexible SSL in the settings. In this case, you will not need to enable SSL on your side.
But, in general, driving open traffic even from CF is somewhat wrong, I think. You can take a few minutes and make a LetsEncrypt certificate to get a valid SSL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question