Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Discussion options

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?)
You must be logged in to vote

I managed to get it via

 client_ip, client_port = websocket.scope.get("client")

But is this really the recommended way?

Replies: 1 comment

Comment options

I managed to get it via

 client_ip, client_port = websocket.scope.get("client")

But is this really the recommended way?

You must be logged in to vote
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
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /