Skip to main content

Connection Variables

Connection Variables

The following variables are available under the conn namespace:

NameTypeDescription
conn.bytes_inint64The number of bytes entering the endpoint from the client.
conn.bytes_outint64The number of bytes leaving an endpoint to the client.
conn.client_ipstringSource IP of the connection to the ngrok endpoint.
conn.client_portint32Source port of the connection to the ngrok endpoint.
conn.server_ipstringThe IP that this connection was established on.
conn.server_portint32The port that this connection was established on.
conn.server_regionstringThe ngrok PoP (Point of Presence) that this connection was established on and serviced through.
conn.ts.starttimestampTimestamp when the connection to ngrok was started.

conn.bytes_in

The number of bytes entering the endpoint from the client.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.bytes_out

The number of bytes leaving an endpoint to the client.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.client_ip

Source IP of the connection to the ngrok endpoint.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.client_port

Source port of the connection to the ngrok endpoint.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.server_ip

The IP that this connection was established on.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.server_port

The port that this connection was established on.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.server_region

The ngrok PoP (Point of Presence) that this connection was established on and serviced through.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.ts.start

Timestamp when the connection to ngrok was started.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

Connection Geo Variables

The following variables are available under the conn.geo namespace:

NameTypeDescription
conn.geo.citystringThe name of the city, in EN, where the conn.client_ip is likely to originate.
conn.geo.countrystringThe name of the country, in EN, where the conn.client_ip is likely to originate.
conn.geo.country_codestringThe two-letter ISO country code where the conn.client_ip is likely to originate.
conn.geo.latitudestringThe approximate latitude where the conn.client_ip is likely to originate.
conn.geo.longitudestringThe approximate longitude where the conn.client_ip is likely to originate.
conn.geo.radiusstringThe radius in kilometers around the latitude and longitude where the conn.client_ip is likely to originate.
conn.geo.subdivisionstringThe name of the subdivision, in EN, where the conn.client_ip is likely to originate.

conn.geo.city

The name of the city, in EN, where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.geo.country

The name of the country, in EN, where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.geo.country_code

The two-letter ISO country code where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.geo.latitude

The approximate latitude where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.geo.longitude

The approximate longitude where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.geo.radius

The radius in kilometers around the latitude and longitude where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.geo.subdivision

The name of the subdivision, in EN, where the conn.client_ip is likely to originate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

Connection TLS Variables

The following variables are available under the conn.tls namespace:

NameTypeDescription
conn.tls.cipher_suitestringThe cipher suite selected during the TLS handshake.
conn.tls.snistringThe hostname included in the ClientHello message via the SNI extension.
conn.tls.versionstringThe version of the TLS protocol used between the client and the ngrok edge.

conn.tls.cipher_suite

The cipher suite selected during the TLS handshake.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.sni

The hostname included in the ClientHello message via the SNI extension.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.version

The version of the TLS protocol used between the client and the ngrok edge.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

Connection TLS Client Variables

The following variables are available under the conn.tls.client namespace:

NameTypeDescription
conn.tls.client.extensions[]ExtensionAdditional information added to the certificate.
conn.tls.client.extensions[i].idstringThe identifier (OID) that specifies the type of extension.
conn.tls.client.extensions[i].criticalboolTrue if the extension is critical.
conn.tls.client.extensions[i].value[]byteThe data for the extension.
conn.tls.client.issuerstringThe issuing authority of the certificate as a string roughly following the RFC 2253 Distinguished Names syntax.
conn.tls.client.issuer.common_namestringCommon name of the issuing authority, usually the domain name.
conn.tls.client.issuer.country[]stringCountry name(s) where the issuing authority is located.
conn.tls.client.issuer.locality[]stringLocality or city of the issuing authority.
conn.tls.client.issuer.organization[]stringName(s) of the organization that issued the certificate.
conn.tls.client.issuer.organizational_unit[]stringDivision of the organization responsible for the certificate.
conn.tls.client.issuer.postal_code[]stringPostal code of the issuing authority.
conn.tls.client.issuer.province[]stringProvince or state of the issuing authority.
conn.tls.client.issuer.street_address[]stringStreet address of the issuing authority.
conn.tls.client.sanstringSubject alternative names of the client certificate.
conn.tls.client.san.dns_names[]stringDNS names in the subject alternative names.
conn.tls.client.san.email_addresses[]stringEmail addresses in the subject alternative names.
conn.tls.client.san.ip_addresses[]stringIP addresses in the subject alternative names.
conn.tls.client.san.uris[]stringURIs in the subject alternative names.
conn.tls.client.serial_numberstringUnique identifier for the certificate.
conn.tls.client.signature_algorithmstringAlgorithm used to sign the certificate.
conn.tls.client.subjectstringThe entity to whom the certificate is issued as a string roughly following the RFC 2253 Distinguished Names syntax.
conn.tls.client.subject.common_namestringCommon name of the subject, usually the domain name.
conn.tls.client.subject.country[]stringCountry name(s) where the subject of the certificate is located.
conn.tls.client.subject.locality[]stringLocality or city where the subject is located.
conn.tls.client.subject.organization[]stringName(s) of the organization to which the subject belongs.
conn.tls.client.subject.organizational_unit[]stringDivision of the organization to which the subject belongs.
conn.tls.client.subject.postal_code[]stringPostal code where the subject is located.
conn.tls.client.subject.province[]stringProvince or state where the subject is located.
conn.tls.client.subject.street_address[]stringStreet address where the subject is located.
conn.tls.client.validity.not_aftertimestampExpiration date and time when the certificate is no longer valid.
conn.tls.client.validity.not_beforetimestampStart date and time when the certificate becomes valid.

conn.tls.client.extensions

Additional information added to the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.extensions[i].id

The identifier (OID) that specifies the type of extension.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.extensions[i].critical

True if the extension is critical.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.extensions[i].value

The data for the extension.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer

The issuing authority of the certificate as a string roughly following the RFC 2253 Distinguished Names syntax.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.common_name

Common name of the issuing authority, usually the domain name.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.country

Country name(s) where the issuing authority is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.locality

Locality or city of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.organization

Name(s) of the organization that issued the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.organizational_unit

Division of the organization responsible for the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.postal_code

Postal code of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.province

Province or state of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.issuer.street_address

Street address of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.san

Subject alternative names of the client certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.san.dns_names

DNS names in the subject alternative names.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.san.email_addresses

Email addresses in the subject alternative names.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.san.ip_addresses

IP addresses in the subject alternative names.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.san.uris

URIs in the subject alternative names.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.serial_number

Unique identifier for the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.signature_algorithm

Algorithm used to sign the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject

The entity to whom the certificate is issued as a string roughly following the RFC 2253 Distinguished Names syntax.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.common_name

Common name of the subject, usually the domain name.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.country

Country name(s) where the subject of the certificate is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.locality

Locality or city where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.organization

Name(s) of the organization to which the subject belongs.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.organizational_unit

Division of the organization to which the subject belongs.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.postal_code

Postal code where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.province

Province or state where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.subject.street_address

Street address where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.validity.not_after

Expiration date and time when the certificate is no longer valid.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.client.validity.not_before

Start date and time when the certificate becomes valid.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

Connection TLS Server Variables

The following variables are available under the conn.tls.server namespace:

NameTypeDescription
conn.tls.server.extensions[]ExtensionAdditional information added to the certificate.
conn.tls.server.extensions[i].idstringThe identifier that specifies the type of extension.
conn.tls.server.extensions[i].criticalboolTrue if the extension is critical.
conn.tls.server.extensions[i].value[]byteThe data for the extension.
conn.tls.server.issuerstringThe issuing authority of the certificate as a string roughly following the RFC 2253 Distinguished Names syntax.
conn.tls.server.issuer.common_namestringCommon name of the issuing authority, usually the domain name.
conn.tls.server.issuer.country[]stringCountry name(s) where the issuing authority is located.
conn.tls.server.issuer.locality[]stringLocality or city of the issuing authority.
conn.tls.server.issuer.organization[]stringName(s) of the organization that issued the certificate.
conn.tls.server.issuer.organizational_unit[]stringDivision of the organization responsible for the certificate.
conn.tls.server.issuer.postal_code[]stringPostal code of the issuing authority.
conn.tls.server.issuer.province[]stringProvince or state of the issuing authority.
conn.tls.server.issuer.street_address[]stringStreet address of the issuing authority.
conn.tls.server.sanstringSubject alternative names of the ngrok server's leaf TLS certificate.
conn.tls.server.san.dns_names[]stringDNS names in the subject alternative names of the ngrok server's leaf TLS certificate.
conn.tls.server.san.email_addresses[]stringEmail addresses in the subject alternative names of the ngrok server's leaf TLS certificate.
conn.tls.server.san.ip_addresses[]stringIP addresses in the subject alternative names of the ngrok server's leaf TLS certificate.
conn.tls.server.san.uris[]stringURIs in the subject alternative names of the ngrok server's leaf TLS certificate.
conn.tls.server.serial_numberstringUnique identifier for the certificate.
conn.tls.server.signature_algorithmstringAlgorithm used to sign the certificate.
conn.tls.server.subjectstringThe entity to whom the certificate is issued as a string roughly following the RFC 2253 Distinguished Names syntax.
conn.tls.server.subject.common_namestringCommon name of the subject, usually the domain name.
conn.tls.server.subject.country[]stringCountry name(s) where the subject of the certificate is located.
conn.tls.server.subject.locality[]stringLocality or city where the subject is located.
conn.tls.server.subject.organization[]stringName(s) of the organization to which the subject belongs.
conn.tls.server.subject.organizational_unit[]stringDivision of the organization to which the subject belongs.
conn.tls.server.subject.postal_code[]stringPostal code where the subject is located.
conn.tls.server.subject.province[]stringProvince or state where the subject is located.
conn.tls.server.subject.street_address[]stringStreet address where the subject is located.
conn.tls.server.validity.not_aftertimestampExpiration date and time when the certificate is no longer valid.
conn.tls.server.validity.not_beforetimestampStart date and time when the certificate becomes valid.

conn.tls.server.extensions

Additional information added to the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.extensions[i].id

The identifier that specifies the type of extension.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.extensions[i].critical

True if the extension is critical.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.extensions[i].value

The data for the extension.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer

The issuing authority of the certificate as a string roughly following the RFC 2253 Distinguished Names syntax.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.common_name

Common name of the issuing authority, usually the domain name.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.country

Country name(s) where the issuing authority is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.locality

Locality or city of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.organization

Name(s) of the organization that issued the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.organizational_unit

Division of the organization responsible for the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.postal_code

Postal code of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.province

Province or state of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.issuer.street_address

Street address of the issuing authority.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.san

Subject alternative names of the server certificate of the ngrok server's leaf TLS certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.san.dns_names

DNS names in the subject alternative names of the ngrok server's leaf TLS certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.san.email_addresses

Email addresses in the subject alternative names of the ngrok server's leaf TLS certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.san.ip_addresses

IP addresses in the subject alternative names of the ngrok server's leaf TLS certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.san.uris

URIs in the subject alternative names of the ngrok server's leaf TLS certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.serial_number

Unique identifier for the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.signature_algorithm

Algorithm used to sign the certificate.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject

The entity to whom the certificate is issued as a string roughly following the RFC 2253 Distinguished Names syntax.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.common_name

Common name of the subject, usually the domain name.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.country

Country name(s) where the subject of the certificate is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.locality

Locality or city where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.organization

Name(s) of the organization to which the subject belongs.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.organizational_unit

Division of the organization to which the subject belongs.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.postal_code

Postal code where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.province

Province or state where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.subject.street_address

Street address where the subject is located.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.validity.not_after

Expiration date and time when the certificate is no longer valid.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…

conn.tls.server.validity.not_before

Start date and time when the certificate becomes valid.

You can use one of the following snippets:

Policy

Loading…

Agent Config

Loading…