Skip to main content

print_server_urls

Function print_server_urls 

Source
pub fn print_server_urls(
    port: u16,
    www_route_prefix: &str,
    index_html_file_name: &str,
)
Expand description

Enumerates all network interface IP addresses and prints each server URL along with its corresponding QR code to the console.

Includes both loopback (127.0.0.1) and all private/public IPv4 addresses bound to the host’s network interfaces. Each address produces one URL line followed by a Unicode QR code rendered with half-block characters, where every line carries the standard log prefix (timestamp + level).

§Arguments

  • u16 - The port number the server is listening on.
  • &str - The www route prefix (e.g. “www”).
  • &str - The index HTML file name (e.g. “index.html”).