-
-
Notifications
You must be signed in to change notification settings - Fork 203
How to get client port in websocket? #417
Answered
by
baseplate-admin
baseplate-admin
asked this question in
Q&A
-
Hi, thank you for creating quart,
I was wondering how to get the client port in the below route:
@app.websocket("/") async def websocket_route(): print(port?)
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
baseplate-admin
Feb 28, 2025
I managed to get it via
client_ip, client_port = websocket.scope.get("client")
But is this really the recommended way?
Replies: 1 comment
-
I managed to get it via
client_ip, client_port = websocket.scope.get("client")
But is this really the recommended way?
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Answer selected by
baseplate-admin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment