Closed decadence closed 5 years ago
I think it is not available out of the box. Botman uses curl_* functions for sending HTTP requests: https://github.com/botman/botman/blob/2.0/src/Http/Curl.php#L8
It is possible to extend BotMan\BotMan\Http\Curl
and add something like curl_setopt($ch, CURLOPT_PROXY, 'socks5://bob:marley@ip:port');
to prepareRequest
method here: https://github.com/botman/botman/blob/2.0/src/Http/Curl.php#L56
@mpociot My suggestion is to add an optional Guzzle adapter for BotMan\BotMan\Interfaces\HttpInterface
: https://github.com/botman/botman/blob/2.0/src/Interfaces/HttpInterface.php
Guzzle already supports proxy (can be configured using constructor). It also has many useful middlewares for caching, testing, logging.
So this functionality can be delegated to a vendor library.
@kubk thanks. I hope @mpociot will consider this necessity because extending core classes is not very convenient way for such small task. Moreover you're right that underlying tools support proxy.
Well there is an interface, so you could just create your own local client and use that?
Can Botman connect to Telegram API via SOCKS5 or MTProto proxy? For example in Russia Telegram is blocked and API can't be used directly