{"categories":[{"label":"WWW/HTTP","url":"https://skillfed.io/packages/category/internet-www-http/2"}],"enrichment":{"capability":"Extracts a client's IP address from web request headers, handling proxies and multiple header formats to identify the originating client in server applications.","skillfed_tags":["web-framework-integration","ip-detection","proxy-handling"],"use_cases":["Log or track client IP addresses in web application request handlers for auditing or analytics.","Implement geolocation-based features by extracting the real client IP behind load balancers or CDNs.","Validate incoming requests against IP allowlists or blocklists in security middleware.","Detect and filter requests from known proxy or VPN services by examining trusted proxy chains.","Attach client IP metadata to user sessions or API calls for debugging and monitoring."],"what_it_does":"python-ipware is a lightweight utility for web applications to retrieve the client's real IP address from HTTP request headers. It handles the complexity of proxy chains and multiple header formats by checking a configurable precedence order of headers (X-Forwarded-For, HTTP_CLIENT_IP, REMOTE_ADDR, and others) and returning an IPv4Address or IPv6Address object with properties like is_global, is_private, and is_loopback.\n\nThe package is designed for Django, Flask, and similar frameworks where the request object is available. It supports proxy validation through proxy_list (trusted proxy IP prefixes) and proxy_count (expected number of proxies in the chain) parameters to help filter spoofed requests. The documentation emphasizes that IP spoofing cannot be completely prevented and recommends using the package only as an additional security layer alongside firewall rules, not as a primary defense mechanism.","worth_installing":"Yes, if you need straightforward client IP extraction in a web framework and are willing to accept dormant maintenance. The package is stable, has no dependencies, and handles the common proxy scenarios well. However, do not rely on it as a primary security mechanism\u2014always pair it with firewall rules and validate proxy chains carefully if IP spoofing is a concern in your threat model."},"id":"python-ipware","links":{"html":"https://skillfed.io/packages/python-ipware","md":"https://skillfed.io/packages/python-ipware.md","pypi":"https://pypi.org/project/python-ipware/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-04-19","license_spdx":null,"license_treatment":"permissive","name":"python-ipware","python_support":"supports_current","summary":"A Python package to retrieve user's IP address"},"popularity":{"monthly_downloads":5327253,"position":2119,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.0.0"}
