It doesn’t work for me. I got as far as the Cloudflare Origin CA certificate warning. Once I told it load anyway, it did nothing but eventually time out. It is doing the same through the proxy now, too, with an error 524.
import https from 'https';
import { readFileSync } from 'fs';
import WebSocket, { WebSocketServer } from 'ws';
const options = {
cert: readFileSync('./crt/cert.pem'),
key: readFileSync('./crt/key.pem')
};
const server = https.createServer(options, (req, res) => {
res.writeHead(200);
res.end(`hello world\n`);
});
const wss = new WebSocketServer({ server });
wss.on('connection', function connection(socket) {
console.log(socket)
});
server.listen(2053);
https://traittor.net:2053/ https server seems working good, but the websockets affilied no. I really dont understand.
I enabled websockets in cloudflare dashboard.
https://jsfiddle.net/t9eL6shd/
If someone can help me, i take it, i have literally no errors it’s terrible
I wonder if the error would not come from HTTP/3 protocol or maybe of my DNS not actualised goodly yet ?