{"id":44294253,"url":"https://github.com/proxymesh/proxy-examples","last_synced_at":"2026-02-11T00:11:39.367Z","repository":{"id":54937772,"uuid":"325995869","full_name":"proxymesh/proxy-examples","owner":"proxymesh","description":"Example code for using proxy servers in different programming languages","archived":false,"fork":false,"pushed_at":"2026-02-08T17:50:35.000Z","size":30,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T23:39:39.516Z","etag":null,"topics":["aiohttp","http","https","httpx","proxy","python","python3","requests","ruby","scrapy","urllib3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/proxymesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-01-01T14:37:35.000Z","updated_at":"2026-02-08T17:50:34.000Z","dependencies_parsed_at":"2022-08-14T07:01:06.168Z","dependency_job_id":null,"html_url":"https://github.com/proxymesh/proxy-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/proxymesh/proxy-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proxymesh%2Fproxy-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proxymesh%2Fproxy-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proxymesh%2Fproxy-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proxymesh%2Fproxy-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/proxymesh","download_url":"https://codeload.github.com/proxymesh/proxy-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proxymesh%2Fproxy-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29322818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","http","https","httpx","proxy","python","python3","requests","ruby","scrapy","urllib3"],"created_at":"2026-02-11T00:11:38.798Z","updated_at":"2026-02-11T00:11:39.360Z","avatar_url":"https://github.com/proxymesh.png","language":"Python","readme":"# Proxy Examples\n\nExample code for using proxy servers in different programming languages. Currently we have examples for these languages:\n\n* Python\n* Ruby\n\n## Python Proxy Examples\n\n### Using python-proxy-headers\n\nThe [python-proxy-headers](https://github.com/proxymesh/python-proxy-headers) library enables sending custom headers to proxy servers and receiving proxy response headers. This is essential for services like [ProxyMesh](https://proxymesh.com) that use custom headers for country selection and IP assignment.\n\n**Installation:**\n\n```bash\npip install python-proxy-headers\n```\n\n**Running Examples:**\n\nAll examples read proxy configuration from environment variables:\n\n```bash\n# Required: Set your proxy URL\nexport PROXY_URL='http://user:pass@proxy.example.com:8080'\n\n# Optional: Custom test URL (default: https://api.ipify.org?format=json)\nexport TEST_URL='https://httpbin.org/ip'\n\n# Optional: Send a custom header to the proxy\nexport PROXY_HEADER='X-ProxyMesh-Country'\nexport PROXY_VALUE='US'\n\n# Optional: Read a specific header from the response\nexport RESPONSE_HEADER='X-ProxyMesh-IP'\n\n# Run a single example\npython python/requests-proxy-headers.py\n\n# Run all examples as tests\npython python/run_tests.py\n\n# Run specific examples\npython python/run_tests.py requests-proxy-headers httpx-proxy-headers\n```\n\n**Examples:**\n\n| Library | Example | Description |\n|---------|---------|-------------|\n| [requests](https://docs.python-requests.org/) | [requests-proxy-headers.py](python/requests-proxy-headers.py) | Simple HTTP requests with proxy headers |\n| requests | [requests-proxy-headers-session.py](python/requests-proxy-headers-session.py) | Session-based requests for connection pooling |\n| [urllib3](https://urllib3.readthedocs.io/) | [urllib3-proxy-headers.py](python/urllib3-proxy-headers.py) | Low-level HTTP client with proxy headers |\n| [aiohttp](https://docs.aiohttp.org/) | [aiohttp-proxy-headers.py](python/aiohttp-proxy-headers.py) | Async HTTP client with proxy headers |\n| [httpx](https://www.python-httpx.org/) | [httpx-proxy-headers.py](python/httpx-proxy-headers.py) | Modern HTTP client with proxy headers |\n| httpx | [httpx-async-proxy-headers.py](python/httpx-async-proxy-headers.py) | Async httpx with proxy headers |\n| [pycurl](http://pycurl.io/) | [pycurl-proxy-headers.py](python/pycurl-proxy-headers.py) | libcurl bindings with proxy headers |\n| pycurl | [pycurl-proxy-headers-lowlevel.py](python/pycurl-proxy-headers-lowlevel.py) | Low-level pycurl integration |\n| [cloudscraper](https://github.com/venomous/cloudscraper) | [cloudscraper-proxy-headers.py](python/cloudscraper-proxy-headers.py) | Cloudflare bypass with proxy headers |\n| [autoscraper](https://github.com/alirezamika/autoscraper) | [autoscraper-proxy-headers.py](python/autoscraper-proxy-headers.py) | Automatic web scraping with proxy headers |\n\n### Basic Proxy Examples\n\n* [requests-proxy.py](python/requests-proxy.py) - Basic proxy usage with requests\n* [requests-random-proxy.py](python/requests-random-proxy.py) - Random proxy rotation\n\n### Scrapy\n\n* [scrapy-proxy-headers.py](python/scrapy-proxy-headers.py) - Scrapy spider with proxy headers\n\n## Ruby Proxy Examples\n\n* [requests_proxy.rb](ruby/requests_proxy.rb) - Ruby HTTP with proxy, from [rpolley](https://github.com/rpolley)\n\n## Documentation\n\nFor more information on using proxy headers with Python:\n\n* [python-proxy-headers on PyPI](https://pypi.org/project/python-proxy-headers/)\n* [python-proxy-headers Documentation](https://python-proxy-headers.readthedocs.io/)\n* [GitHub Repository](https://github.com/proxymesh/python-proxy-headers)\n\n## Contributing\n\nIf you have example code for another language, please share it with a Pull Request.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproxymesh%2Fproxy-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproxymesh%2Fproxy-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproxymesh%2Fproxy-examples/lists"}