F
F
fgjcirifb2019-02-01 19:45:15
Laravel
fgjcirifb, 2019-02-01 19:45:15

How to work with proxy on Botman?

You need to work through a proxy on Botman. Found an issue on GitHub for my problem. The package author says that you need to create your own service provider and configure Curl yourself there:

BotMan Studio loads the BotManServiceProvider in your config/app.php
The service provider loads BotMan through the factory. And the factory create method ibstanciates curl.
https://github.com/botman/botman/blob/master/src/B...
So just create your own service provider instead of the BotMan one and use the custom creation code.
https://github.com/botman/botman/blob/master/src/B...

But you can't change anything in BotManServiceProvider.php. There's just this line:
$botman = BotManFactory::create(config('botman', []), new LaravelCache(), $app->make('request'), $storage);

And where do you see here that you can call curl_setopt? It can only be called in the BotMan\BotMan\Http\Curl class, but cannot be changed.
What to do? Or forget about it and just try to proxy all requests from PHP through some kind of program?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question