EMILUA(3em)

πŸ“¦ version 0.12.1, in nixos 26.05, nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so this is the EMILUA(3em) page β€” the Emilua reference, bestie. And Emilua is literally the Lua execution engine. That's the whole name vibe: Emilua - Lua execution engine. It's giving highkey iconic main character energy, ngl. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

no cap, here's the synopsis in all its code-y glory β€” exactly as written:

local s = tls.socket.new(ip.tcp.dial('www.example.com:https'))
s:client_handshake()
s = http.socket.new(s)

local req = http.request.new()
local res = http.response.new()
req.headers.host = 'www.example.com'

s:write_request(req)
s:read_response(res)

πŸ’… FUNCTIONS πŸ’…

✨ new(sock: ip.tcp.socket[, tls_ctx: tls.context]) β†’ tls.socket

Constructor. Slay.

If tls_ctx is not provided, a per-VM β€” generated on first use β€” default one will be used. That's the tea. β˜•

🌸 client_handshake(self)

Perform the TLS client handshake and suspend current fiber until operation finishes. Periodt. 🫢

πŸ¦‹ server_handshake(self)

Perform the TLS server handshake and suspend current fiber until operation finishes. Iconic. ✨

πŸ“ read_some(self, buffer: byte_span) β†’ integer

Read data from the stream socket and blocks current fiber until it completes or errs.

Returns the number of bytes read. No cap. πŸ“–

πŸ’œ write_some(self, buffer: byte_span) β†’ integer

Write data to the stream socket and blocks current fiber until it completes or errs.

Returns the number of bytes written. Fr fr. ✍️

πŸŽ€ set_server_name(self, hostname: string)

Sets the server name indication. Cute and to the point. πŸ’…

🌈 set_verify_callback(self, callback: string[, callback_options...])

Set the callback used to verify peer certificates.

For now only one callback is supported:

  • "host_name_verification" β€” callback_options will be a single string containing the host name.

iykyk. 🧚

⭐ set_verify_depth(self, depth: integer)

Set the peer verification depth. That's it, that's the function. πŸ‘‘

πŸ”₯ set_verify_mode(self, mode: string)

Set the peer verification mode.

mode might be one of the following:

  • "none".
  • "peer".
  • "fail_if_no_peer_cert".
  • "client_once".
ngl bestie, these mode strings are the whole vibe check β€” keep them exactly as written. 🫢

mwah πŸ’‹ β€” this page's source/version is Emilua 0.12.1-nixpkgs1, dated 1980-01-01. That's the manual, bestie. Slay, and read the docs. πŸŽ€βœ¨

πŸ“¦ where this page comes from