PHPackages                             flosch/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. flosch/proxy-bundle

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

flosch/proxy-bundle
===================

Authenticated symfony3 bundle: Authentication layer on top of a PHP proxy.

1.1.2(9y ago)028MITJavaScript

Since Jan 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/flo-sch/proxy-bundle)[ Packagist](https://packagist.org/packages/flosch/proxy-bundle)[ Docs](https://github.com/flo-sch/FloschProxyBundle)[ RSS](/packages/flosch-proxy-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Symfony FloschProxyBundle
=========================

[](#symfony-floschproxybundle)

Authenticated symfony bundle: provides an authentication layer on top of a PHP proxy.

This bundle provides a User model and a YamlUserProvider, to authenticate users based on a yml file. It also provides a Symfony command to add users with encrypted passwords.

Once the user is connected, it provides a PHP proxy thanks to [Guzzle PHP library](http://docs.guzzlephp.org/), currently v6.

### Why?

[](#why)

This bundle is usefull if you want to proxy an HTTP application, with an authentication layer a bit stronger than http standards such as HTTP\_BASIC.

### Security

[](#security)

**Please note that this bundle will be security-wise usefull if, and only if, you can provide an HTTPS certificate for your domain.**

### Requirements

[](#requirements)

- Symfony 3.0 or above

### Installation

[](#installation)

To install this bundle, run the command below and you will get the latest version from [Packagist](https://packagist.org/).

```
composer require flosch/proxy-bundle
```

### Usage

[](#usage)

Load required bundles in AppKernel.php:

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = [
        // [...]
        new Flosch\Bundle\ProxyBundle\FloschProxyBundle()
    ];
}
```

Set up configuration

```
# app/config/config.yml
twig:
    # [...]
    globals:
        proxy_title: Your Proxy title

# FloschProxyBundle uses assetic (for the login page)
# However, you can override the templates and manage it yourself in any other way if you prefer.
assetic:
    # [...]
    bundles: [ FloschProxyBundle ]

flosch_proxy:
    base_url: http://127.0.0.1:8888/ # The URL you will actually proxy
    users_provider_file_path: "%kernel.root_dir%/../var/users.yml"
```

###### Style

[](#style)

For the login page, FloschProxyBundle uses an icons font called [Font Awesome](http://fontawesome.io/). If you wish to keep the icons of the login page, you will need to copy the fonts sources to the `web/fonts` folder of your project. If you prefer not to use it, feel free to surcharge the login page template, by extending this bundle, as explained later in this doc.

Set up routing

app/config/routing.yml or any other routing file
================================================

[](#appconfigroutingyml-or-any-other-routing-file)

```
flosch_proxy:
    resource: "@FloschProxyBundle/Resources/config/routing.yml"
    prefix:   /
```

Set up security

```
# app/config/security.yml
security:
    encoders:
        # The FloschProxyBundle User model class, you can choose your favorite encoder
        Flosch\Bundle\ProxyBundle\Model\User:
            algorithm:            bcrypt
            cost: 17

    providers:
        # [...]
        proxy_users:
            id: flosch_proxy.provider.yaml_user_provider

    firewalls:
        # [...]
        flosch_proxy_app_login:
            pattern:  ^/login$
            security: false

        flosch_proxy_app:
            pattern:  ^/
            provider: proxy_users
            form_login:
                check_path: flosch_proxy_login_check_page
                login_path: flosch_proxy_login_page
                always_use_default_target_path: true
                default_target_path: /
            logout:
                path:   flosch_proxy_logout_page
                target: /

    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: ROLE_USER }
```

### Authentication and users management

[](#authentication-and-users-management)

Here we are!

This bundle comes with a service called YamlUserProvider, providing users from a yaml file. To add an access, add a new yaml array of this user's informations :

```
# /path/of/your/users.yml
username:
    salt: # the salt used to encrypt the password, depending of the encoder you chosse, this might be optional (ex: bcrypt).
    password: # the encrypted password
```

You also have two commands to manage users from the console :

To create a new user :

```
php bin/console flosch-proxy:users:create [username] [password] [--all]
```

Both username and password arguments are optionnal, the command will ask for it if you do not provide it. The `--override` (or ````-o`````) option allow to replace an existing user's password (if the user does not exists, he will be created).

To remove an existing user :

```
php bin/console flosch-proxy:users:remove [username] [--all]
```

Username argument is optionnal, the command will ask for it if you do not provide it. The `--all` option allow to remove every existing users from the file.

### Extend the bundle

[](#extend-the-bundle)

The Bundle itself provides the security layer, with login and logout routes ; And a default login page, before "proxying" routes through the Guzzle client.

As a symfony bundle, you can extend it, to benefits of [Symfony inheritance](http://symfony.com/doc/3.2/cookbook/bundles/inheritance.html), Then override resources and / or controllers:

```
Controller/
    ProxyController.php --> Manage PHP proxy once authenticated
    Security/
        AuthenticationController.php --> Manage authentication
Resources/
    views/
        layout.html.twig --> Base template with HTML doctype
        Security/
            login.html.twig --> Login page template

```

All you need to do is setting up your own bundle as child of FloschProxyBundle:

```
// src/YourBundleName/YourBundleName.php
namespace YourBundleName;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class YourBundleName extends Bundle
{
    public function getParent()
    {
        return 'FloschProxyBundle';
    }
}
```

### Authors

[](#authors)

- Florent Schildknecht ([Portfolio](http://floschild.me))

### License

[](#license)

This bundle is released under the [MIT license](Resources/LICENSE)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~0 days

Total

4

Last Release

3406d ago

### Community

Maintainers

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

---

Top Contributors

[![flo-sch](https://avatars.githubusercontent.com/u/1577155?v=4)](https://github.com/flo-sch "flo-sch (4 commits)")

---

Tags

clientsymfonybundleproxyrestcurlhttp clientsecurityAuthentication

### Embed Badge

![Health badge](/badges/flosch-proxy-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/flosch-proxy-bundle/health.svg)](https://phpackages.com/packages/flosch-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)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[zoonman/pixabay-php-api

PixabayClient is a PHP HTTP client library to access Pixabay's API

3354.7k](/packages/zoonman-pixabay-php-api)[opgg/riotquest

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

172.6k](/packages/opgg-riotquest)

PHPackages © 2026

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