Guide to proxy management in SERPS

Provided you have a working proxy, this short guide will show you to use it with SERPS in a standardized way.

Create a proxy

Proxy creation is possible in two ways. You can either build it from a simple proxy string, or with proxy parts

Create a proxy from a string

Assuming we have the proxy as a string, for instance with, you can use this string to create the proxy:

 use Serps\Core\Http\Proxy;

 $proxy = Proxy::createFromString('');

By default the proxy will be a HTTP proxy but serps proxy also accepts HTTPS, SOCKS4 and SOCKS5 proxies, see with examples:

 use Serps\Core\Http\Proxy;

 $httpProxy = Proxy::createFromString('');
 $httpsProxy = Proxy::createFromString('');
 $socks4Proxy = Proxy::createFromString('socks4://');
 $socks5Proxy = Proxy::createFromString('socks5://');

You can also add authentication details (by default no authentication is set). You can do it by using the form authentication@host:

    use Serps\Core\Http\Proxy;

    $proxy = Proxy::createFromString('https://user:password@');

Create a proxy from parts

Now let's consider that you have some proxy parts (ip, port...) that are not put together as a string, you can use them directly with the proxy constructor to create a new proxy:

    use Serps\Core\Http\Proxy;

    $ip   = '';
    $port = 8080;

    $proxy = new Proxy($ip, $port);

By default authentication is disabled and the proxy is an HTTP proxy but you can provide these details:

    use Serps\Core\Http\Proxy;

     $type = 'HTTP';
     $ip   = '';
     $port = 8080;
     $user = 'user';
     $pass = 'password';

    $proxy = new Proxy($ip, $port, $user, $pass, $type);

What to do with proxies

These proxies are aimed to be used by Browser instances. Find example on how to use them on the browser documentation