Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting a custom Guzzle HTTP Client for requests. #536

Merged

Conversation

noplanman
Copy link
Member

@noplanman noplanman commented Jun 11, 2017

After setting the $telegram object, it is very easy to set a custom Guzzle HTTP Client to allow a custom API URL or simply to modify various parameters (like SSL verification):

Request::setClient(new \GuzzleHttp\Client([
    'base_uri' => 'https://149.154.167.197',
    'proxy'    => 'tcp://123.45.67.12:3128',
    'verify'   => false,
]));

For Windows users, copy this snippet into your hook.php or getUpdatesCLI.php or manager.php file, before the $telegram->handle(); call:

Request::setClient(new \GuzzleHttp\Client([
    'base_uri' => 'https://api.telegram.org',
    'verify'   => false,
]));

Fixes #507
Fixes #511

@noplanman noplanman requested a review from jacklul June 11, 2017 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants