PHPackages                             cnerta/behind-a-proxy-bundle - 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. cnerta/behind-a-proxy-bundle

AbandonedArchivedSymfony-bundle[HTTP &amp; Networking](/categories/http)

cnerta/behind-a-proxy-bundle
============================

Add proxy parameters for CURL, SoapClient connection and PHP function using stream context.

2.0.1(10y ago)2542MITPHPPHP &gt;=5.5.9

Since Nov 13Pushed 6y ago2 watchersCompare

[ Source](https://github.com/AgrosupDijon-Eduter/BehindAProxyBundle)[ Packagist](https://packagist.org/packages/cnerta/behind-a-proxy-bundle)[ RSS](/packages/cnerta-behind-a-proxy-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

/!\\ Repository not maintained and outdated /!\\
================================================

[](#-repository-not-maintained-and-outdated-)

Cnerta Behind A Proxy Bundle
============================

[](#cnerta-behind-a-proxy-bundle)

Add proxy parameters for CURL, SoapClient connection and PHP function using stream context.

[![SensioLabsInsight](https://camo.githubusercontent.com/8f2fb0ea086d7fbc1b04459baeb566710975b1fc8043f60ab8c7fb750029d58c/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37356231353463652d363063302d343566332d383963372d6532333737306538336561612f6269672e706e67)](https://insight.sensiolabs.com/projects/75b154ce-60c0-45f3-89c7-e23770e83eaa)

[![Build Status](https://camo.githubusercontent.com/5dffe5d4f613ec536d5946621b0f16c02bebe5af9cbe290223e240fd5f0b6780/68747470733a2f2f7472617669732d63692e6f72672f4167726f73757044696a6f6e2d4564757465722f426568696e644150726f787942756e646c652e706e67)](https://travis-ci.org/AgrosupDijon-Eduter/BehindAProxyBundle)[![Latest Stable Version](https://camo.githubusercontent.com/215b5140ef3b4d9302e1bac02b514e7205174ed0da40d26f3223cf5be380e015/68747470733a2f2f706f7365722e707567782e6f72672f636e657274612f626568696e642d612d70726f78792d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/cnerta/behind-a-proxy-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/92c0bd2eeda70ba48cf8f9f6160208909c667a005389264727f95ede12c7974f/68747470733a2f2f706f7365722e707567782e6f72672f636e657274612f626568696e642d612d70726f78792d62756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/cnerta/behind-a-proxy-bundle)

> **WARNING** `host_ssl` configuration has been removed since version 2.0.0
> For **PHP 5.4 and below**, please use the version 1 of the bundle

Install the Bundle
------------------

[](#install-the-bundle)

1. Add the sources in your composer.json

```
     "require": {
        // ...
        "cnerta/behind-a-proxy-bundle": "1.0.*"
    }
```

2. Then add it to your AppKernel class::

```
    // in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new Cnerta\BehindAProxyBundle\CnertaBehindAProxyBundle(),
        // ...
    );
```

Configuration
-------------

[](#configuration)

config.yml

```
    cnerta_behind_a_proxy:
        enabled: false                # type: boulean, default value: false, desc: enabled (true), or desabled (false) the use of proxy
        host: 127.0.0.1               # type: string, default value: null, desc : this is the IP or URL of the proxy server
        port: 80                      # type: mixed(string|int), default value: null, desc : this is the port of the proxy server
        login: myWonderfulLogin       # type: string, default value: null, desc : this is the login for authentication against the proxy server
        password: myWonderfulLogin    # type: string, default value: null, this is the password for authentication against the proxy server
        load_default_stream_context: false    # type: boolean, default value: false, If you need to set the default proxy config global
        http:       # Option set only for http request
            host_proxy: 127.0.0.1     # type: string, default value: null, desc : this is the IP or URL of the proxy server
            port_proxy: 80            # type: mixed(string|int), default value: null, desc : this is the port of the proxy server
            login_proxy: login        # type: string, default value: null, desc : this is the login for authentication against the proxy server
            password_proxy: password  # type: string, default value: null, this is the password for authentication against the proxy server
            request_fulluri: true     # type: boulean, default value: false, desc: enabled (true), or desabled (false) the full uri option of context
        https:      # Option set only for https request
            host_proxy: 127.0.0.1     # type: string, default value: null, desc : this is the IP or URL of the proxy server
            port_proxy: 80            # type: mixed(string|int), default value: null, desc : this is the port of the proxy server
            login_proxy: login        # type: string, default value: null, desc : this is the login for authentication against the proxy server
            password_proxy: password  # type: string, default value: null, this is the password for authentication against the proxy server
            request_fulluri: true     # type: boulean, default value: false, desc: enabled (true), or desabled (false) the full uri option of context
```

Set configuration proxy for CURL
--------------------------------

[](#set-configuration-proxy-for-curl)

```
    use Symfony\Component\DependencyInjection\ContainerInterface;
    /**
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
     */
    private $container;

    //...

    $s = curl_init();
    curl_setopt($s, CURLOPT_BINARYTRANSFER, true);
    curl_setopt($s, CURLOPT_FAILONERROR, true);
    curl_setopt($s, CURLOPT_RETURNTRANSFER, true);

    curl_setopt($s, CURLOPT_URL, $this->url);

    // Call cnerta.baproxy service and call the method setProxyForCURL
    // the CURL resource '$s' is passed by reference
    $container->get('cnerta.baproxy')->setProxyForCURL($s);

    curl_exec($s);
    $status = curl_getinfo($s, CURLINFO_HTTP_CODE);
    $error = curl_error($s);

    curl_close($s);

    if ($status == 401) {
        throw new \RuntimeException("Invalid Credencial to connect to WebService");
    } else if ($status == 404) {
        throw new \RuntimeException("Invalid URL to connect to WebService");
    } elseif ($status != 200) {
        throw new \RuntimeException($error);
    }
```

Set configuration proxy for SoapClient
--------------------------------------

[](#set-configuration-proxy-for-soapclient)

```
    use Symfony\Component\DependencyInjection\ContainerInterface;
    /**
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
     */
    private $container;

    //...

    $config =  array(
        "trace" => true,
        "exceptions" => 0,
        "cache_wsdl" => WSDL_CACHE_NONE
    );

    $container->get('cnerta.baproxy')->setProxyForSoapClient($config);

    $soapClient = new \SoapClient('http://www.somewhere.com/?wsdl', $config);
```

Get Parameters anywhere
-----------------------

[](#get-parameters-anywhere)

```
    use Symfony\Component\DependencyInjection\ContainerInterface;
    /**
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
     */
    private $container;

    //...

    $this->container->getParameter("cnerta_baproxy.enabled")
    $this->container->getParameter("cnerta_baproxy.host")
    $this->container->getParameter("cnerta_baproxy.port")
    $this->container->getParameter("cnerta_baproxy.host_ssl")
    $this->container->getParameter("cnerta_baproxy.login")
    $this->container->getParameter("cnerta_baproxy.password")
    $this->container->getParameter("cnerta_baproxy.http")
    $this->container->getParameter("cnerta_baproxy.https")
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97.6% 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 ~176 days

Recently: every ~220 days

Total

6

Last Release

3686d ago

Major Versions

1.0.2 → 2.0.02016-04-13

PHP version history (3 changes)1.0.0PHP &gt;=5.3.2

1.0.1PHP &gt;=5.3.3

2.0.1PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/598557aca5160bd06926b1a7a7e31097fec14d2bb3937d5597cd9f4efb64ff44?d=identicon)[waldo2188](/maintainers/waldo2188)

---

Top Contributors

[![waldo2188](https://avatars.githubusercontent.com/u/841872?v=4)](https://github.com/waldo2188 "waldo2188 (41 commits)")[![wtfred](https://avatars.githubusercontent.com/u/3072924?v=4)](https://github.com/wtfred "wtfred (1 commits)")

---

Tags

bundleproxySymfony2cnerta

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cnerta-behind-a-proxy-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/cnerta-behind-a-proxy-bundle/health.svg)](https://phpackages.com/packages/cnerta-behind-a-proxy-bundle)
```

###  Alternatives

[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[fresh/centrifugo-bundle

Provides communication with web-socket server Centrifugo in Symfony applications.

83375.3k](/packages/fresh-centrifugo-bundle)[leaseweb/api-caller-bundle

cURL API call functionality with full Web Debug Toolbar integration

64417.4k1](/packages/leaseweb-api-caller-bundle)

PHPackages © 2026

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