mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 05:02:01 -06:00
[GH-ISSUE #9491] Proxy Configuration via Environment Variables and Global Request Sessions #31058
Reference in New Issue
Block a user
Originally created by @ashm-dev on GitHub (Feb 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9491
Description
Hello!
I would like to propose two enhancements to improve performance and simplify the codebase:
Enable the ability to configure proxies through environment variables, for example:
PROXY=protocol://ip:portImplement global sessions for both aiohttp and requests. This approach would offer several advantages:
Reusing the TCP connection pool will reduce the overhead of establishing new connections, thereby speeding up request processing.
Managing session settings (such as headers, timeouts, proxies, etc.) in a single location simplifies maintenance and ensures consistency across the application.
A global session reduces the need to repeatedly initialize and manage individual sessions, leading to cleaner and more maintainable code.
Benefits
By reusing TCP connections, the application can handle requests more efficiently.
Centralizing session configurations simplifies adjustments and reduces the risk of inconsistencies.
Fewer session initializations and closures make the codebase easier to understand and maintain.
Thank you for considering this proposal!