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

576
Views
Solicitud de origen cruzado bloqueada: la misma política de origen no permite leer el recurso remoto (motivo: la solicitud de CORS no tuvo éxito)

¿Cómo configurar cors en node.js para socket.io v2.2.0? (ngx-socket-io:3.4.0).

Intenté configurar como sigue pero no pude hacer la conexión:

 var http = require('http'); var {app,io} = require('../router/nexusservices.router'); var wfwsdk = require('wfw-sdk'); var Service = wfwsdk.getServiceConfigurations('nexusservices'); if (Service) { var port = normalizePort(Service.port); // fix Cross-Origin Request Blocked issue app.use(function (req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "*"); res.header("Access-Control-Allow-Methods", "*"); if (req.method === "OPTIONS") { return res.status(200).end(); } next(); }); app.set('port', port); /** * Create HTTP server. */ var server = http.createServer(app); server.listen(port); server.on('error', onError); server.on('listening', onListening); io.attach(server); io.set('origins', '*:*'); //////// not working
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!