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 TLS with TCP transport #100

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Gelf/Transport/TcpTransport.php
Expand Up @@ -40,14 +40,15 @@ class TcpTransport extends AbstractTransport
*
* @param string $host when NULL or empty DEFAULT_HOST is used
* @param int $port when NULL or empty DEFAULT_PORT is used
* @param string $scheme Allowed scheme for stream sockets, e.g. 'tcp' or 'tls'
*/
public function __construct($host = self::DEFAULT_HOST, $port = self::DEFAULT_PORT)
public function __construct($host = self::DEFAULT_HOST, $port = self::DEFAULT_PORT, $scheme = 'tcp')
{
// allow NULL-like values for fallback on default
$host = $host ?: self::DEFAULT_HOST;
$port = $port ?: self::DEFAULT_PORT;

$this->socketClient = new StreamSocketClient('tcp', $host, $port);
$this->socketClient = new StreamSocketClient($scheme, $host, $port);
$this->messageEncoder = new DefaultEncoder();
}

Expand Down