PHPackages                             aalfiann/pubproxy-class-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. aalfiann/pubproxy-class-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

aalfiann/pubproxy-class-php
===========================

Get working public proxy list for free by PubProxy (No API key required).

1.2.0(7y ago)11783[1 issues](https://github.com/aalfiann/pubproxy-class-php/issues)MITPHPPHP &gt;=5.4

Since Nov 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aalfiann/pubproxy-class-php)[ Packagist](https://packagist.org/packages/aalfiann/pubproxy-class-php)[ RSS](/packages/aalfiann-pubproxy-class-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (5)Used By (0)

PubProxy Class PHP
==================

[](#pubproxy-class-php)

[![Version](https://camo.githubusercontent.com/dacaf7bf17972a4e7bcb9401f3013bd36e9447193d63843898bed877486161e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61616c6669616e6e2f70756270726f78792d636c6173732d7068702e737667)](https://github.com/aalfiann/pubproxy-class-php)[![Downloads](https://camo.githubusercontent.com/6623983c3040d655cecdf79fa6f9b8cb32679210d5ad588c8b4323f9afca73ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61616c6669616e6e2f70756270726f78792d636c6173732d7068702e737667)](https://packagist.org/packages/aalfiann/pubproxy-class-php)[![License](https://camo.githubusercontent.com/1c6ffac76419939b254f80828f9a1d9fdbd6bc2dd76ab9e59be0535313c4a3e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61616c6669616e6e2f70756270726f78792d636c6173732d7068702e737667)](https://github.com/aalfiann/pubproxy-class-php/blob/HEAD/LICENSE.md)

Get working public proxy list for free by PubProxy (No API key required).

Known Limitations
-----------------

[](#known-limitations)

As free user, there is only 50 request a day. So we cached the request per 30minutes to save your quota.
We recommend you to buy the premium proxy to get the best experience, realtime and unlimited.

Installation
------------

[](#installation)

Install this package via [Composer](https://getcomposer.org/).

```
composer require "aalfiann/pubproxy-class-php:^1.0"

```

Usage
-----

[](#usage)

### Get Proxy (Rotate Automatically)

[](#get-proxy-rotate-automatically)

```
require_once ('vendor/autoload.php');
use \aalfiann\PubProxy;

$proxy = new PubProxy;
echo $proxy->make()->getProxy();
```

### Get Proxy List

[](#get-proxy-list)

```
require_once ('vendor/autoload.php');
use \aalfiann\PubProxy;

$proxy = new PubProxy;
// with Json format
echo $proxy->make()->getJson();
// with Text format
echo $proxy->make()->getText();
```

### Get Proxy List with Custom Options

[](#get-proxy-list-with-custom-options)

```
require_once ('vendor/autoload.php');
use \aalfiann\PubProxy;

$proxy = new PubProxy;
$proxy->level = 'elite';
$proxy->type = 'http';
$proxy->country = 'us';
$proxy->make()->getJson();
```

Chain Usage Example
-------------------

[](#chain-usage-example)

```
require_once ('vendor/autoload.php');
use \aalfiann\PubProxy;

$proxy = new PubProxy;
echo $proxy->setLevel('elite')->setType('http')->setCountry('us')->make()->getJson();
```

Properties PubProxy
-------------------

[](#properties-pubproxy)

- `$api='',$level='',$type='',$country='',$not_country='',$port='',$google='',$https='',$post='',$user_agent='',$cookies='',$referer='',$limit=5,$last_check=0,$speed=0;`

Properties Feature
------------------

[](#properties-feature)

- `$refresh=1800,$dircache='',$filepath='',$proxy='',$proxyauth='',$response,$resultArray=null;`

Chain Function
--------------

[](#chain-function)

- **setApi($api='')** this will make your request realtime and unlimited by buying **PubProxy Premium**.
- **setLimit($limit=5)** this will display proxies by limit number. Default is 5.
- **setType($type='')** this will display proxies by proxy protocol (socks4, socks5 and http).
- **setLevel($level='')** this will display proxies by anonymity level (anonymous and elite).
- **setLastCheck($last\_check=0)** this will display proxies which is how long minutes the proxy was last checked?
- **setSpeed($speed=0)** this will display proxy which is how many seconds it takes for the proxy to connect?
- **setCountry($country='')** this will display proxy from country that we wanted (input multiple with separated commas).
- **setNotCountry($not\_country='')** this will display avoided proxy countries (input multiple with separated commas).
- **setPort($port='')** this will display proxies with a specific port (input multiple with separated commas).
- **setGoogle($google='')** this will display proxies which is Google passed proxies.
- **setHttps($https='')** this will display proxies which is supports HTTPS request.
- **setPost($post='')** this will display proxies which is supports POST request.
- **setUserAgent($user\_agent='')** this will display proxies which is supports USER\_AGENT request.
- **setCookies($cookies='')** this will display proxies which is supports COOKIES request.
- **setReferer($referer='')** this will display proxies which is supports REFERER request.
- **setRefresh($refresh=1800)** this will cache the proxy. Default is 1800 seconds (every 30minutes proxy will refresh automatically).
- **setDirCache($dircache='')** this will set directory location without change the default filename cache. Default is "cache-proxy".
- **setFilepath($filepath='')** this will create custom file cache. Default is "cache-proxy/{{md5}}.cache".

Main Function
-------------

[](#main-function)

- **make()** Make process to get proxy list response.
- **getJson()** Get response as json format.
- **getText()** Get response as text/plain format
- **getProxy()** Get single proxy (ip:port and rotate automatically if the proxy limit is more than 1)

Cache Function
--------------

[](#cache-function)

- **isHit()** to check the cached proxy list is still valid or not
- **fetch()** to fetch the cached proxy list
- **write($content)** to write proxy list data to file cache.
- **clear()** to clear the file cache

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Total

4

Last Release

2565d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c101f6be505e4713be942f6b80d849b46702e6f4069430e1dbbe60fa18289c54?d=identicon)[aalfiann](/maintainers/aalfiann)

---

Top Contributors

[![aalfiann](https://avatars.githubusercontent.com/u/9458941?v=4)](https://github.com/aalfiann "aalfiann (5 commits)")

---

Tags

proxyhttp-proxyanonymouseliteproxy-listfree-proxyscan-proxypublic-proxysocks-proxy

### Embed Badge

![Health badge](/badges/aalfiann-pubproxy-class-php/health.svg)

```
[![Health](https://phpackages.com/badges/aalfiann-pubproxy-class-php/health.svg)](https://phpackages.com/packages/aalfiann-pubproxy-class-php)
```

###  Alternatives

[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48819.2M541](/packages/nette-http)[jenssegers/proxy

Proxy library that forwards requests to the desired url and returns the response.

940487.2k4](/packages/jenssegers-proxy)[zounar/php-proxy

Forward your HTTP/HTTPS requests to another server.

1814.0k](/packages/zounar-php-proxy)[clue/http-proxy-react

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP

472.3M33](/packages/clue-http-proxy-react)[willwashburn/phpamo

A PHP library to create urls for Camo - the SSL image proxy

42159.6k1](/packages/willwashburn-phpamo)[flowpack/varnish

Varnish integration for Neos

2052.9k](/packages/flowpack-varnish)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
