Skip to content

[Question] WebSocket config example #54

@plankter

Description

@plankter

Could you please provide an example of how to configure access to WebSockets? For instance, to the following endpoint:

@app.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket):
    await websocket.accept()
    await websocket.send_text(f"WebSocket client connected")

I could't connect to the endpoint from the client app, getting Error during WebSocket handshake: Unexpected response code: 200. I suppose, either Traefik or Nginx configs should be changed.

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