CORS error #1590
Unanswered
anshuljain633
asked this question in
Q&A
CORS error
#1590
Replies: 2 comments 1 reply
-
The server configuration seems okay to me. Some intermediary that you have between your server and your client might be stripping the CORS headers from the responses. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm using nginx container and supervisor to run gunicorn server. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @miguelgrinberg
I'm getting this error at the client:
i'm using supervisor to run gunicorn server
client side code
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.js"></script>server side ->
app = Flask(name)
socketio = SocketIO(app,cors_allowed_origins="*")
values = {
'slider1': 25,
'slider2': 0,
}
@app.route('/')
def index():
return render_template('index.html',**values)
@socketio.on('connect')
def test_connect():
emit('after connect', {'data':'Lets dance'})
@socketio.on('Slider value changed')
def value_changed(message):
values[message['who']] = message['data']
emit('update value', message, broadcast=True)
cors = CORS(app,resources={r"/":{"origins":""}})
if name == 'main':
socketio.run(app, host='0.0.0.0')
Beta Was this translation helpful? Give feedback.
All reactions