Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
port = 443
use_ssl = not config.suppress_ssl
if not use_ssl:
port = 80
if config.force_domain:
endpoint = config.force_domain
if config.debug_local:
endpoint = Domain.LOCAL
port = 8081
use_ssl = False
preamble = 'PUT /%s/hosts/%s/%s/?realtime=1 HTTP/1.0\r\n\r\n' % (
config.user_key, config.agent_key, log_key)
# Special case for HTTP PUT
# Use plain formatter if no formatter is defined
transport = Transport(endpoint, port, use_ssl, preamble, config.debug_transport_events,
(config.proxy_type, config.proxy_url, config.proxy_port))
transports.append(transport)
# Default formatter is plain
if not entry_formatter:
entry_formatter = formats.get_formatter('plain', config.hostname, log_name, log_token)
else:
continue
# Default formatter is syslog
if not entry_formatter:
entry_formatter = formats.get_formatter('syslog', config.hostname, log_name, log_token)
# Instantiate the follower
follower = Follower(log_filename, entry_filter, entry_formatter, entry_identifier, transport)
followers.append(follower)
return (followers, transports)
port = self._config.datahub_port
else:
endpoint = Domain.DATA
if use_ssl:
port = 443
else:
port = 80
if config.force_domain:
endpoint = self._config.force_domain
elif self._config.force_data_host:
endpoint = self._config.force_data_host
if self._config.debug_local:
endpoint = Domain.LOCAL
port = 10000
use_ssl = False
self._transport = Transport(
endpoint, port, use_ssl, '', self._config.debug_transport_events,
(self._config.proxy_type, self._config.proxy_url, self._config.proxy_port))
return self._transport