Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capturing web client info: IP and user agent #1302

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Conversation

FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Apr 17, 2023

New page properties: client_ip and client_user_agent. Close #1053

Usage example:

import flet as ft

def main(page: ft.Page):

    page.add(
        ft.Text(f"Client IP: {page.client_ip}"),
        ft.Text(f"Client user agent: {page.client_user_agent}"),
    )

ft.app(target=main, port=8550, view=ft.WEB_BROWSER)

New `page` properties: `client_ip` and `client_user_agent`.
Close #1053
@FeodorFitsner FeodorFitsner merged commit 981b7b0 into main Apr 17, 2023
@FeodorFitsner FeodorFitsner deleted the client-info branch April 17, 2023 18:04
@tokyohandsome
Copy link

How can we get those properties from a web app (flet build web)?

@ndonkoHenri
Copy link
Collaborator

It is because you the result of Flet build web is a static website.
In this state you can read neither the ip nor the client user agent.
Your app needs to be deployed as a web app for it to work but not as a static app.

zrr1999 pushed a commit to zrr1999/flet that referenced this pull request Jul 17, 2024
New `page` properties: `client_ip` and `client_user_agent`.
Close flet-dev#1053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: More session info
3 participants