Skip to content

Socket IO not supported #35

@dedtadeas

Description

@dedtadeas

Hi,

I have python Socket IO server based on

from flask import Flask, jsonify, request
from flask_socketio import SocketIO
from flask_cors import CORS
import logging

# Flask and SocketIO setup
app = Flask(__name__)
socketio = SocketIO(app, cors_allowed_origins="*", engineio_logger=True)  # Initialize SocketIO once

# Flask CORS
CORS(app, resources={r"/*": {"origins": "*"}})

@socketio.on("connect")
def handle_connect():
    logging.info("Client connected")
...
@socketio.on("disconnect")
def handle_disconnect():
    logging.info("Client disconnected")

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    socketio.run(
        app, host="0.0.0.0", port=20003, debug=False, allow_unsafe_werkzeug=True,
    )

It seems that Socket IO is not supported by this plugin at the moment. When I try to create a connection in Grafana (locally), I receive :
Query A - Starting WebSocket: connection Error: websocket: bad handshake"
On server side I get 404 bad request...

  1. I think there should be support for Socket IO for this plugin since it is pretty common.
  2. Can u give point me to the WebSocket server implementation, which is compatible with grafana-websocket-plugin?

Thank you!
Best from
TD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions