Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

397
Vistas
Flask-SocketIo always using Polling

I have made an web app with flask and implemented socket-io in it using Flask-SocketIO but it is continuously using Polling method instead of Web Sockets.

My JS file:

$(document).ready(function(){
    socket = io.connect(document.location.protocol + '//' + document.domain, {rememberTransport: false});

    socket.on('connect', function() {
        console.log('Websocket connected!');
    });

    socket.on('status', function(data) {
        console.log("HIIIIII");
    });
});

And my app.py file:

from flask import Flask
from flask_socketio import SocketIO, emit

app = Flask(__name__)

# My all other functions

@socketio.on('connect')
def connect_handler():
    print("f")

@socketio.on('status')
def status(message):
    emit('status', {'msg': session.get('name') + ' has entered the room.'})

if __name__ == '__main__':
    app.debug = True
    socketio.init_app(app)
    socketio.run(app)

And my Chrome Console is generating the following polling error:

GET https://example.com/socket.io/?EIO=4&transport=polling&t=O2ylx6M 404

It is hosted on vercel.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda