Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
can't connect to websocket (Mixed Content)

so i was trying to make web socket server

node js

const WebSocket = require("ws");
var porth = process.env.PORT || 80;
const wss = new WebSocket.Server({port:porth})

wss.on("connection", ws => {
    console.log("nowe połączenie");
    ws.on("message",  data => {
        console.log(data.toString());
    });
    ws.send("hej");
    ws.on("close", () =>
    {
        console.log("rozłączenie");
    });
})

app.js

ws.addEventListener("open", () => {
  console.log("połączono")
  ws.send("test");
  ws.addEventListener("message", data => {
    console.log(data.data)
  })
})

and when i host it on my pc it works but when i upload it to github pages it keeps sending me error:

Mixed Content: The page at 'https://*****.github.io/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://****.herokuapp.com/'. This request has been blocked; this endpoint must be available over WSS.

and i dont know what should i do about it

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So from this error I assume that you are connecting between secure and not secure site. I'm not sure but if I can I would suggest you to see ws https server. Maybe this will help https://github.com/websockets/ws#external-https-server

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!