{"id":15490910,"url":"https://github.com/kirillplatonov/proxy_manager","last_synced_at":"2025-04-24T07:30:17.997Z","repository":{"id":13337043,"uuid":"16024104","full_name":"kirillplatonov/proxy_manager","owner":"kirillplatonov","description":"Ruby proxy manager. Gem for easy usage proxy in parser/web bots.","archived":false,"fork":false,"pushed_at":"2022-08-03T03:42:54.000Z","size":95,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T08:08:08.621Z","etag":null,"topics":["crawler","parser","proxy","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/kirillplatonov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["kirillplatonov"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2014-01-18T11:19:56.000Z","updated_at":"2024-11-04T12:53:33.000Z","dependencies_parsed_at":"2022-08-20T23:40:36.536Z","dependency_job_id":null,"html_url":"https://github.com/kirillplatonov/proxy_manager","commit_stats":null,"previous_names":["bloodyhistory/proxy_manager"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillplatonov%2Fproxy_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillplatonov%2Fproxy_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillplatonov%2Fproxy_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillplatonov%2Fproxy_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirillplatonov","download_url":"https://codeload.github.com/kirillplatonov/proxy_manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250582740,"owners_count":21453910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["crawler","parser","proxy","ruby"],"created_at":"2024-10-02T07:41:12.271Z","updated_at":"2025-04-24T07:30:17.980Z","avatar_url":"https://github.com/kirillplatonov.png","language":"Ruby","funding_links":["https://github.com/sponsors/kirillplatonov"],"categories":[],"sub_categories":[],"readme":"# Ruby Proxy Manager\n\n[![Gem Version](https://badge.fury.io/rb/proxy_manager.svg)](http://badge.fury.io/rb/proxy_manager)\n[![Build Status](https://travis-ci.org/kirillplatonov/proxy_manager.svg?branch=master)](https://travis-ci.org/kirillplatonov/proxy_manager)\n[![Code Climate](https://codeclimate.com/github/kirillplatonov/proxy_manager.png)](https://codeclimate.com/github/kirillplatonov/proxy_manager)\n[![Coverage](https://codeclimate.com/github/kirillplatonov/proxy_manager/coverage.png)](https://codeclimate.com/github/kirillplatonov/proxy_manager)\n\nEasy manage proxy in your parsers/web-bots.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'proxy_manager'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n\n```bash\n$ gem install proxy_manager\n```\n\n## Usage\n\n### Load proxy list\n\nFrom array (IP:PORT)\n\n```ruby\nproxy = ProxyManager::Proxy.new(['127.0.0.1:80', '127.0.0.1:8080'])\n```\n\nor from file\n\n```ruby\nproxy = ProxyManager::Proxy.new('proxies.txt')\n```\n\nFile with proxy list (in this case `proxies.txt`) should be readable and\nwritable.\nExample of `proxies.txt` content:\n\n```\n127.0.0.1:80\n127.0.0.1:8080\n...\n```\n\n### Get proxy\n\nThere is two methods to get proxy.\n\nFirst method return just next proxy, without any checking for availability:\n\n```ruby\nproxy.get\n# =\u003e [\"127.0.0.1\", 80]\n```\n\nBand method return **only HTTP-available proxy**. It's perfect if you don't\nrealy confidency on actuallity of your proxy list:\n\n```ruby\nproxy.get!\n# =\u003e [\"127.0.0.1\", 8080]\n```\n\nYou can also get for than one proxy per request by adding count for both\nmethods like this:\n\n```ruby\nproxy.get(2)\n# =\u003e [[\"127.0.0.1\", 80], [\"127.0.0.1\", 8080]]\n\nproxy.get!(2)\n# =\u003e [[\"127.0.0.1\", 80], [\"127.0.0.1\", 8080]]\n```\n\n### Proxies list\n\nFor display list of loaded proxies use `list` method:\n\n```ruby\nproxy.list\n# =\u003e [[\"127.0.0.1\", 80], [\"127.0.0.1\", 8080]]\n```\n\n### Checking proxy manually\n\nYou can also use class method for checking availability manually like this:\n\n```ruby\n# by passing a string\nProxyManager::Proxy.connectable?('127.0.0.1:80')\n# =\u003e false\n\n# or by passing an array\nProxyManager::Proxy.connectable?('127.0.0.1', 80)\n# =\u003e false\n```\n\nPlease, don't forget to star :star: the repository if you like (and use) the library. This will let me know how many users it has and then how to proceed with further development :).\n\n## Documentation\n\nhttp://rubydoc.info/gems/proxy_manager\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillplatonov%2Fproxy_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirillplatonov%2Fproxy_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillplatonov%2Fproxy_manager/lists"}