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

Add availability for X-Forwarded-For HTTP header #1002

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

acordier16
Copy link

@acordier16 acordier16 commented May 18, 2024

  • Add X-Forwarded-For HTTP header availability in the Chainlit user session

The goal is to be able to gather the client IP address from the Chainlit user session, in order for example to apply rate limiting on client IP adresses using limits.

Note: currently, the headers are not available within the session (see #964 and #393).

Usage:

client_ip = cl.user_session.get("http_forwarded_for")

@acordier16 acordier16 changed the title feature/http_forwarded_for Add availability for X-Forwarded-For HTTP header May 18, 2024
@dokterbob
Copy link
Collaborator

Seems like a must-have feature for many production applications. But, then again, would this not be superseded by generic access to the full request in on_chat_start() as proposed in #1213?

@dokterbob dokterbob added the backend Pertains to the Python backend. label Aug 22, 2024
@dokterbob dokterbob added the enhancement New feature or request label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Pertains to the Python backend. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants