Coder Social home page Coder Social logo

Use a proxy ? about firebase-bundle HOT 4 CLOSED

kreait avatar kreait commented on June 25, 2024
Use a proxy ?

from firebase-bundle.

Comments (4)

adpeyre avatar adpeyre commented on June 25, 2024

If you are agree with #60 , I could use my own ProjectFactory class to define the proxy.

class ProjectFactory extends \Kreait\Firebase\Symfony\Bundle\DependencyInjection\Factory\ProjectFactory
{
    public function createFactory(array $config = []): Factory
    {
        $factory = parent::createFactory($config);

        $httpClientOptions = HttpClientOptions::default();
        $httpClientOptions = $httpClientOptions->withGuzzleConfigOptions([
            'proxy' => 'http://proxy',
        ]);

        return $factory->withHttpClientOptions($httpClientOptions);
    }
}

from firebase-bundle.

adpeyre avatar adpeyre commented on June 25, 2024

I decided not to use the bundle. There are some issues and I can't override configurations.
So I used the php sdk only.

I share my config for a messaging usage with an unique client :

    ####
    # Kreait Firebase
    ####
    kreait_firebase.http_config_options:
        class: Kreait\Firebase\Http\HttpClientOptions
        factory: ['Kreait\Firebase\Http\HttpClientOptions', 'default']
        calls:
            - withProxy: !returns_clone ['%env(HDS_HTTP_PROXY)%']

    Kreait\Firebase\Factory:
        calls:
            - withHttpClientOptions: !returns_clone ['@kreait_firebase.http_config_options']
            - withServiceAccount: !returns_clone ['%env(resolve:FIREBASE_CREDENTIALS_PATH)%']
            - withHttpLogger: !returns_clone ['@monolog.logger.firebase']

    Kreait\Firebase\Contract\Messaging:
        factory: ['@Kreait\Firebase\Factory', 'createMessaging']

from firebase-bundle.

jeromegamez avatar jeromegamez commented on June 25, 2024

Good call, that's how I would recommend it anyway - perhaps I should update the README at some point...

Anyway, thanks for sharing, it will certainly be useful to others. I'll keep this and/or the other issue open for the time being, perhaps I can find some time somewhen.

from firebase-bundle.

jeromegamez avatar jeromegamez commented on June 25, 2024

Since you've given an example how to use the SDK without this bundle (again: 👏), and I've merged #60, I'll close this issue now, but feel free to add further comments if you'd like.

from firebase-bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.