Questions tagged [flask-sockets]

Flask-Sockets is a Flask extension which makes it easier for developers to use Web Sockets in their Flask projects.

Flask-Sockets is a Flask extension which makes it easier for developers to use Web Sockets in their Flask projects.

39 questions
0
votes
1 answer

React + Flask-Socket.io: Socket disconnection event from client delayed when browser is closed?

My React component: import React, { useState, useEffect } from 'react'; import {Redirect} from "react-router-dom"; import io from "socket.io-client"; function Game({userName, roomCode}) { const [users, setUsers] = useState([]) …
Vimal Raj
  • 11
  • 1
0
votes
1 answer

Handling websocket disconnect in Python Flask server using RxPY for push based events

Context I am using RxPY to enable sending push based events via websockets. I am using flask-sockets in a Flask server with gevent. The events class contains an rx.subject.BehaviorSubject that acts as an event publisher, while the websocket clients…
Alex Predescu
  • 792
  • 2
  • 7
  • 24
0
votes
1 answer

onSnapshot() Firestore sending changes multiple times with Flask-Sockets

I'm trying to develop a web chat with Flask and Firestore. I set a flow to receive new messages from firestore (when something changes at the database) and send through websockets to UI. Something like that: Python: @sockets.route('/messages') def…
0
votes
0 answers

Gcp pub/sub consume messages into websockets route

In my view after I receive post with data I sent it to gcp pub/sub topic. I've got websockets where I'd like to read that data send earlier: @sockets.route('/ws//some_url/') def some_function(ws, _id): if mine_id not in…
Stanislav
  • 67
  • 2
  • 8
0
votes
1 answer

Flask-Sockets keepalive

I recently started using flask-sockets in my flask application with native WebSocket API as client. I would like to know if there is proper way to send ping requests at certain intervals from the server as keepalive? When going through the…
Jonathan Hamel
  • 1,393
  • 13
  • 18
0
votes
0 answers

aws Ec2 ubuntu - importing module with an underscore in the name

i'm trying to deploy some python program on my EC2 instance. In the code there is this line: from flask_sockets import Sockets Error: ModuleNotFoundError: No module named 'flask_sockets' But flask_sockets is installed, pip freeze…
socialb
  • 135
  • 1
  • 9
0
votes
1 answer

Python Flask-Sockets not working within blueprints

I am experimenting with Flask-Sockets. Support for Blueprints was added in the past, something I really do need. from flask import Flask, request, abort, redirect, url_for, render_template, make_response, Response, jsonify, session import…
lennyklb
  • 1,307
  • 2
  • 15
  • 32
0
votes
1 answer

SocketIO not receiving message in JS

I'm trying to implement a FlaskSocketIO with socket.io.js application for real-time communication between frontend and my web socket server The frontend code looks like that: $(document).ready(function() { namespace = '/test'; var…
-2
votes
1 answer

Flask webapp with chat client (using websockets to another server)

Currently, I have a dynamic website that runs on Flask and I'd like to implement a chat client in the back-end that utilizes websockets that will connect to an external server. So, for example, I'd like to start a websocket to this external chat…
simboyd
  • 93
  • 1
  • 8
1 2
3