I have a node js bot deployed on a secure HTTPS server (Repl.it). It outputs to the console regularly, and I need others to see this output. They cannot because they do not have access to my repl.it account (and the console there is terrible anyway). I don’t have access to the server, nor its security certificates.
I’m looking for a way to make the bot send data (its console.log()
commands) to my website, so I can manage the bot’s progress. My website is also deployed on a HTTPS server on Repl.it. The connection doesn’t even need to be bidirectional. Server-to-client is all I need really. (The bot uses environment variables and must be always on, so it cannot be run from a browser, has to be deployed to a background server.)
I have followed numerous tutorials, trying Axios, Express.js, Socket.io, using CORS and its various options, Server-sent events, and a few other options. I cannot get wss:// to work. I’m new at this type of coding, so I’m unsure if I’m trying in vain, or just missing something simple. I keep getting the error: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
I have seen this similar question, but it’s from 2013, for Java, I’m unsure how I’d implement it, and I don’t know if it’s what I need anyway.
Most examples and tutorials online only show HTTP implementations, but I haven’t been able to get any of them to work, I think because my platforms are both HTTPS.
Any help would be greatly appreciated! Thank you in advance.
Agathos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.