Fixie works with any http client library, including urllib2 from the standard library and third-party packages including the popular requests package.
Using requests
To route a specific request through Fixie using requests:
If you intend to route all outbound traffic through Fixie, a simpler option is to set the http_proxy and https_proxy environment variables. Both urllib2 and requests honor the http_proxy and https_proxy environment variables, so you can route all outbound requests through Fixie using these environment variables:
Using urllib2
Using urllib2 to send a specific request through Fixie:
The
urllib2API is significantly more verbose than that of therequestspackage. Therequestspackage is a better choice for most applications.
Related static IP guides
Platform-specific guides for giving your Python app a static outbound IP:
- Python on Heroku → API
- Python on Vercel → API
- Python on Render → Postgres
- Python on AWS Lambda → API
- Python on Fly.io → API
- Python on Heroku → Postgres
See the full list of static IP guides for every supported language, platform, and destination.
Is this guide useful?
Having issues? Please reach out to our team here.