Module net

Source
Expand description

Β§Common network utilities.

ModulesΒ§

dns πŸ”’
DNS resolution and cache.
http πŸ”’
HTTP module.
proxy πŸ”’
Proxy support.
session πŸ”’
tls πŸ”’
TLS support.

StructsΒ§

HttpResponse
HTTP(S) GET response.

ConstantsΒ§

CACHE_TTL πŸ”’
TTL for caches in seconds.
TIMEOUT πŸ”’
Connection, write and read timeout.

FunctionsΒ§

connect_tcp πŸ”’
If load_cache is true, may use cached DNS results. Because the cache may be poisoned with incorrect results by networks hijacking DNS requests, this option should only be used when connection is authenticated, for example using TLS. If TLS is not used or invalid TLS certificates are allowed, this option should be disabled.
connect_tcp_inner πŸ”’
Returns a TCP connection stream with read/write timeouts set and Nagle’s algorithm disabled with TCP_NODELAY.
connect_tls_inner πŸ”’
Attempts to establish TLS connection given the result of the hostname to address resolution.
load_connection_timestamp πŸ”’
Returns timestamp of the most recent successful connection to the host and port for given protocol.
prune_connection_history πŸ”’
Removes connection history entries after CACHE_TTL.
read_url
Retrieves the text contents of URL using HTTP GET request.
read_url_blob
Retrieves the binary contents of URL using HTTP GET request.
run_connection_attempts πŸ”’
Runs connection attempt futures.
update_connection_history πŸ”’
Update the timestamp of the last successful connection to the given host and port with the given application protocol alpn.