flask-socketio

How can you get real time copy progress of a large file with Python?

妖精的绣舞 提交于 2021-02-19 02:24:27
问题 I've searched high and low, and each time I find something that looks promising it's not panned out. Ultimately I want to grab the real time progress of a file copy on a linux machine from inside python. I'll take that progress and emit it to a client web page with Flask-SocketIO, likely threaded to avoid blocking. I don't mind if it's rsync, copy, or any other means...(shutil etc) to handle the actual copy. I just want a hook to push an update over the socket. Thus far I've found this to be

How do i properly install flask-socketIO?

流过昼夜 提交于 2021-02-08 11:15:46
问题 I have installed multiple times Flask-socketio on my mac, closely reading the instructions and installing the requirements (eventlet/gevent). Athough when i run my simple code to test, it either says that i have not imported the modules or show nothing until i open index.html in my browser where it then displays : The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Here is my app.py code: from

How do i properly install flask-socketIO?

冷暖自知 提交于 2021-02-08 11:14:11
问题 I have installed multiple times Flask-socketio on my mac, closely reading the instructions and installing the requirements (eventlet/gevent). Athough when i run my simple code to test, it either says that i have not imported the modules or show nothing until i open index.html in my browser where it then displays : The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Here is my app.py code: from

Instant messaging with Flask-socketIO

柔情痞子 提交于 2021-02-08 07:32:08
问题 I want to implement an instant messaging server using Flask + Flask-soketIO. with client side on mobile phone (front in Ionic 2) I have already tried different chat room examples with socketIO but I wonder how to manage multiple users chatting two by two. I'm not yet familiar with instant messaging architectures. I have several questions on the subject : first of all, is Flask a good framework to implement instant messaging for mobile phone application ? I did start with Flask because it

Instant messaging with Flask-socketIO

♀尐吖头ヾ 提交于 2021-02-08 07:31:09
问题 I want to implement an instant messaging server using Flask + Flask-soketIO. with client side on mobile phone (front in Ionic 2) I have already tried different chat room examples with socketIO but I wonder how to manage multiple users chatting two by two. I'm not yet familiar with instant messaging architectures. I have several questions on the subject : first of all, is Flask a good framework to implement instant messaging for mobile phone application ? I did start with Flask because it

How to setup flask-socketio in a docker container?

纵饮孤独 提交于 2021-02-07 19:41:30
问题 Hello I'm trying to setup flask-socketio in a docker container. It seems to run but I get an error( from the browser) when I try to access localhost on port 5000 like I'm used to do with flask apps. It say's: unable to connect! I will show you the 5 important files: Dockerfile, requirements.txt, docker-compose.yml, web_app.py and index.html Dockerfile: FROM python:3.6.5 WORKDIR /code COPY * /code/ RUN pip install -r requirements.txt requirements.txt: Flask==1.0.2 Flask-SocketIO==3.0.1

Swift socket.io compatible version with server python-socketio

时光总嘲笑我的痴心妄想 提交于 2021-01-29 15:31:06
问题 I've searched couple of days for it but found nothing to fix this issue. My client is an iOS device running socket.io v15.2.0 (Oct 17, 2019). I've followed this post (Implement a WebSocket Using Flask and Socket-IO(Python)) That post described how to connect to the python socket server with a javascript client but even the javascript client has also returned same error :| Then I checked the compatibility table at this page and found out that the latest version only works with the javascript

Is there a way to login a user using Flask Socket IO?

独自空忆成欢 提交于 2021-01-29 09:43:57
问题 I'm using Flask with Flask SocketIO and Flask Login . My issue is that when I tried to use the login_user function inside of a socketio.on event, there is no error, but the user isn't logged in. My example might help illustrate this. my example event will be called for the user to login, and then /usersonly will be for after that event is called. @socketio.on('my example event') def my_func(json): ... login_user(user) @app.route('/usersonly') @login.user_required def my_call(): print(current

How to use custom id as session id in Flask Socket IO

不羁岁月 提交于 2021-01-29 08:54:44
问题 I am using flask socket-io for a basic chat app. But I have a problem. When my device connect to server, flask give to device a session id. But after disconnect and again connect, session id changes. So, this device can't receive old room's messages. I thought if I'd do if I assign custom session id to device.Is it true? Or what is your suggestions? 回答1: The session ids are supposed to be unique, even when a client reconnects. There is no way for an application to choose these ids, they are

Flask-Socketio not emitting from external RQ process

房东的猫 提交于 2020-12-13 18:51:03
问题 I'm running a flask server that connects to an iOS client with Flask-Socketio. The server has to process some complicated data, and since that takes a while to solve, I do it in a background job using Redis Queue. Communication works fine normally, but I need to emit to the client, and write to database once the job finishes, and I am trying to do that from the job function (if there is a way to let the app know when the job is finished, the app could handle all communication in one place).