Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.43 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.43 KB

Guzzle Socket Handler Build Status Code Climate

Warning
This package is deprecated since cURL 7.40.0.
Use curl_setopt with CURLOPT_UNIX_SOCKET_PATH option instead of this package (available in cURL 7.40.0 (PHP 7.0.7))

Unix socket handler for guzzle 6.

Installation

composer require psrebniak/guzzle-socket-handler

Usage:

\GuzzleHttp\Client([
    'handler' => new \psrebniak\GuzzleSocketHandler\SocketHandlerFactory(
        $path
        [, $domain = AF_UNIX 
        [, $type = SOCK_STREAM 
        [, $protocol = SOL_SOCKET
        ]]]
    )
]); 

Request options (from \psrebniak\GuzzleSocketHandler\SocketOptions)

  • SOCKET_TIMEOUT - alias of RequestOptions::CONNECT_TIMEOUT
  • SOCKET_DEBUG - alias of RequestOptions::DEBUG

Done:

  • sending JSON ($options[RequestOptions::JSON] key)
  • sending form params ($options[RequestOptions::FORM_PARAMS] key)
  • sending multipart ($options[RequestOptions::multipart] key)
  • tracking redirects ($options[RequestOptions::ALLOW_REDIRECTS] key)
  • timeout ($options[RequestOptions::CONNECT_TIMEOUT] key)
  • Http Authentication ($options[RequestOptions::AUTH] key)