How to get connected user agent string #4226
-
QuestionI want to reach connected browsers user agent string and connected party's IP address. I try to write by help of AI (Chatgpt,gemini) but all code does not work. Can someone help me thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jan 15, 2025
Replies: 1 comment 1 reply
-
Hi @muratbedir, In @ui.page('/')
def index():
ui.label(ui.context.client.ip)
ui.label(ui.context.client.request.headers['user-agent']) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
muratbedir
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @muratbedir,
In
ui.context
you can find theclient
object with information about the connection and the request: