OptionalhostThe destination hostname or IP address. Defaults to 'localhost'
The destination port number (1-65535)
OptionaltagsOptional key-value pairs for metrics collection and logging. These tags will be attached to connection-related metrics.
This is provided for convenience since tags can also be specified during socket creation via SocketOptions. Tags specified here will override tags with the same name specified when creating the socket.
OptionaltlsEnable TLS/SSL encryption for this connection.
When enabled, the socket will perform a TLS handshake after establishing the TCP connection. TLS configuration (certificates, verification, cipher suites, etc.) is controlled by k6's standard TLS settings.
Common use cases:
Configuration options for establishing a TCP socket connection.
Example