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

180
Views
Usando ws y wss simultáneamente

Estoy tratando de hacer que ws y wss funcionen, en un servidor WebSocket.

Esto es lo que tengo actualmente, solo wss

 var WebSocket = require('ws'); var https = require('https'); var privateKey = fs.readFileSync('cert/key.key'); var certificate = fs.readFileSync('cert/cert.crt'); var httpsServer = https.createServer({ ca: ca, key: privateKey, cert: certificate }, this.app); var options = { server: httpsServer, perMessageDeflate: false, maxPayload: 4096 }; var wss = new WebSocket.Server(options);

Sé que usar Socket.io es realmente fácil, solo puede hacer io.attach(httpServer) e io.attach(httpsServer) .

 var httpServer = http.createServer(this.app); var httpsServer = https.createServer({ key: privateKey, cert: certificate }, this.app); httpServer.listen(3002, function(){ console.log('httpServer listening on port 3002'); }); httpsServer.listen(3003, function(){ console.log('httpsServer listening on port 3003'); }); this.io = new ioServer(); this.io.attach(httpServer); this.io.attach(httpsServer);

¿Es esto posible usando esta biblioteca WebSocket ?

over 4 years ago · Santiago Trujillo
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!