flask-socketio

Using eventlet to manage socketio in Flask

时光毁灭记忆、已成空白 提交于 2020-07-04 13:58:11
问题 I am trying to set up a small server to handle HTTP and socketio requests -- I don't have much experience setting up servers, but right now apache2 serves the http just fine. The socketio transactions, however, keep failing with error code 400 (bad request), and I see some strange errors in the server logs. Sometimes I see an engineio error and the server responds w/ a 'bad request' and code 400, but always it tells me the eventlet server needs to be started: [Mon Jan 11 19:02:54.068282 2016]

Using eventlet to manage socketio in Flask

跟風遠走 提交于 2020-07-04 13:57:56
问题 I am trying to set up a small server to handle HTTP and socketio requests -- I don't have much experience setting up servers, but right now apache2 serves the http just fine. The socketio transactions, however, keep failing with error code 400 (bad request), and I see some strange errors in the server logs. Sometimes I see an engineio error and the server responds w/ a 'bad request' and code 400, but always it tells me the eventlet server needs to be started: [Mon Jan 11 19:02:54.068282 2016]

Closing Flask-SocketIO gracefully in python

我的未来我决定 提交于 2020-06-18 03:51:48
问题 I'm using flask-socketio for server side in python. When running on windows10 the .stop() function of the flask_socketio.SocketIO works and closes the socket which terminates my script but on Unubtu it thrown exception. I want it to be closed properly. My code: import time import threading import flask import flask_socketio def start_server( vars ): vars[ "app" ] = flask.Flask(__name__) vars[ "app" ].config['SECRET_KEY'] = 'secret!' vars[ "socketio" ] = flask_socketio.SocketIO( vars[ "app" ]

is it possible to use flask_socketio with connexion?

喜欢而已 提交于 2020-04-30 08:47:15
问题 I have a django app (frontend) which sends requests to a connexion api (backend). Now I want to add info to the user to know the progression of the request in real-time upon making a request to my api. Example: from my django app, if I submit a form it will launch a request via requests.post and will show me some text ( ie: creating, deleting, updating ...) I tried using flask-socketio but I found no example of how it could be done. (connexion with socketio) PS: I want to use connexion for my

is it possible to use flask_socketio with connexion?

房东的猫 提交于 2020-04-30 08:46:45
问题 I have a django app (frontend) which sends requests to a connexion api (backend). Now I want to add info to the user to know the progression of the request in real-time upon making a request to my api. Example: from my django app, if I submit a form it will launch a request via requests.post and will show me some text ( ie: creating, deleting, updating ...) I tried using flask-socketio but I found no example of how it could be done. (connexion with socketio) PS: I want to use connexion for my

How to stream live video frames from client to flask server and back to the client?

独自空忆成欢 提交于 2020-04-16 03:59:45
问题 I am trying to build a client server architecture where I am capturing the live video from user's webcam using getUserMedia(). Now instead of showing video directly in <video> tag, I want to send it to my flask server, do some processing on frames and throw it back to my web page. I have used socketio for creating a client-server connection. This is the script in my index.html . Please pardon my mistakes or any wrong code. <div id="container"> <video autoplay="true" id="videoElement"> </video

Socket IO 1.x server library for python

情到浓时终转凉″ 提交于 2020-01-17 04:26:04
问题 is there any socket io 1.x server library for python? I have found https://github.com/miguelgrinberg/Flask-SocketIO but only support for socket io version 0.9.16, this is the author say : Please do not use the new socket.io 1.0 client libraries, that is a very recent release that is likely not supported by project gevent-socketio. Please use 0.9.16 for now. https://github.com/miguelgrinberg/Flask-SocketIO/issues/33 Please help me :) 来源: https://stackoverflow.com/questions/29428273/socket-io-1

How can I avoid to use global variables? (python - flask-socketio app)

我的未来我决定 提交于 2020-01-02 22:09:30
问题 I'm trying to figure out how to not use global variables for my application but I can't think of anything else. I'm actually coding a web interface with the help of the Flask-SocketIO module to interact in real time with a music player. This is a snippet of my code containing the play function (I think I only need one example and then I can adapt it for all the other functions): from flask import Flask, render_template from flask_socketio import SocketIO app = Flask(__name__) socketio =

Flask-SocketIO 502 Error on AWS EC2 with [CRITICAL] Worker Timeouts

夙愿已清 提交于 2019-12-25 03:14:15
问题 I'm setting up a reverse-proxy NGINX EC2 deployment of a flask app on AWS by following this guide. More specifically, I'm using a proxy pass to a gunicorn server (see config info below). Things have been running smoothly, and the flask portion of the setup works great. The only thing is that, when attempting to access pages that rely on Flask-SocketIO, the client throws a 502 (Bad Gateway) and some 400 (Bad Request) errors. This happens after successfully talking a bit with the server, but

Setting up dynamic chat rooms in FlaskSocketIO chat

孤者浪人 提交于 2019-12-24 10:48:43
问题 I want to let user's of my mini chat to create their rooms dynamically. For now i got const in flask server app: # Predefined rooms for chat ROOMS = ["Lounge", "news", "games", "coding", "food", "cars"] And user join/leave routes are in flask: @socketio.on('join') def on_join(data): username = data["username"] room = data["room"] join_room(room) # Notofication about new user joined room send({"msg": username + " has joined the " + room + " room."}, room=room) @socketio.on('leave') def on