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

131
Views
SocketIO works on localhost but not over HTTPS

so I'm very new to this Web-Development stuff and I'm currently working on a Tic Tac Toe Multiplayer Game that works perfectly in my local network. Now I bought a Domain for practice and I am stuck on this error:

GET https://backend.MYDOMAIN.games/socket.io/?EIO=4&transport=polling&t=NxFY-hh 404

This is my backend code:

const express = require('express')
const app = express();

const fs = require('fs')
const http = require('http')
const https = require('https');
const { Server } = require('socket.io')
const privateKey  = fs.readFileSync('./nodmod2/key.pem');
const certificate = fs.readFileSync('./nodmod2/cert.pem');

const credentials = {key: privateKey, cert: certificate};

const httpServer = http.createServer(app)
const httpsServer = https.createServer(credentials, app)

const io = new Server(httpsServer);

io.on('connection', (socket) => {
    socket.send("connected.")
})

app.get('/debug2', (req, res) => {
    res.send('Works')
})

httpServer.listen(8080)
console.log("HTTP auf 8080")
httpsServer.listen(3000);
console.log("HTTPS auf 3000")

And this is how I am connecting to it:

const socket = io("https://backend.MYDOMAIN.games/debug2");
socket.on('connect', () => {
    displayID(`Your ID: ${socket.id}`)
})

On localhost:3000, this works fine. But not with my domain. What am I missing?

about 4 years ago · Juan Pablo Isaza
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!