-
Notifications
You must be signed in to change notification settings - Fork 32
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 specify cURL options for connections to providers #25
Comments
OK found the Problem, UrlShortner needs to first geht the oAuth key, so I have to add it there also: public function getAccessToken()
{
$client = new Client( [
'base_uri' => 'https://api-ssl.bitly.com/oauth/access_token',
'curl' => [
CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5_HOSTNAME,
CURLOPT_PROXY => 'localhost'
],
]);
$response = $client->post(null, [
'auth' => [
$this->username,
$this->password,
],
]);
return $response->getBody()->getContents();
} |
Even I found a solution to my Problem, it would be nice to add the possibility to set cUrl options globaly for all modules if needed. |
Hi @gnadelwartz , Yes you're right, we could pass options in construct as the provider. |
even it may not look like, I'm a noob in php programing :) I can write simple php scripts and copy solutions from stack overflow or find simple fixes, I'm more a Shell hacker from stone age |
Hello mremi,
I must use UrlShortner with socks5 for some reasons. Unfortunately the typical shell hackers solution using
proxychains shorten ...
does not work with php compiled against glibc.The solution for my own calls to cURL is to provide some cURL options:
unfortunately - for me - you are using guzzle so I can't set CURLOPT direct, but luckly guzzle privides the possiblilty to pass cURL options
As UrlShortner is working with user and password on my server, I tried to add the the socks5 options to your bitly provider for shortening, but it has ho effect:
Are I'm doing something fundamentally worng or did I miss something?
Any other ideas?
The text was updated successfully, but these errors were encountered: