160 lines
4.4 KiB
HTML
160 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="MontaukOS manual page: fetch(1) - HTTP/HTTPS client for MontaukOS">
|
|
<title>fetch(1) - MontaukOS Manual</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
font-family: 'Open Sans', Arial, sans-serif;
|
|
max-width: 960px;
|
|
margin: 0 auto;
|
|
padding: 1em;
|
|
line-height: 1.5;
|
|
display: flex;
|
|
gap: 2em;
|
|
}
|
|
p { margin: 0 0 0.5em; }
|
|
h2 { margin: 0.5em 0; }
|
|
.sidebar {
|
|
width: 160px;
|
|
flex-shrink: 0;
|
|
}
|
|
.sidebar ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
}
|
|
.sidebar li {
|
|
margin: 0.5em 0;
|
|
}
|
|
.sidebar a {
|
|
color: #0066CC;
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
}
|
|
.sidebar a:hover {
|
|
color: #004499;
|
|
text-decoration: underline;
|
|
}
|
|
.sidebar .current {
|
|
color: #004499;
|
|
}
|
|
.sidebar hr {
|
|
border: none;
|
|
border-top: 1px solid #999;
|
|
margin: 0.75em 0;
|
|
}
|
|
.main {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
a { color: #0000EE; }
|
|
a:visited { color: #0066CC; }
|
|
hr { border-style: solid; border-width: 1px 0 0 0; border-color: #999; }
|
|
pre { background: #f0f0f0; padding: 0.5em; overflow-x: auto; }
|
|
code { background: #f0f0f0; padding: 0 0.15em; }
|
|
pre code { padding: 0; }
|
|
.center { text-align: center; }
|
|
.box {
|
|
border: 1px solid #999;
|
|
padding: 0.5em;
|
|
margin: 0.5em 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="sidebar">
|
|
<ul>
|
|
<li><a href="../../index.html">Home</a></li>
|
|
<li><a href="../index.html">Documentation</a></li>
|
|
</ul>
|
|
<hr>
|
|
<ul>
|
|
<li><a href="index.html" class="current">Man Pages</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="main">
|
|
<div class="center">
|
|
<h1>fetch(1)</h1>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<pre><code><strong>NAME</strong>
|
|
fetch - HTTP/HTTPS client for MontaukOS
|
|
|
|
<strong>SYNOPSIS</strong>
|
|
fetch [-v] <url>
|
|
fetch [-v] <host> <port> [path]
|
|
|
|
<strong>DESCRIPTION</strong>
|
|
fetch performs an HTTP/1.0 GET request and prints the response
|
|
body to the terminal. Supports both plain HTTP and HTTPS (TLS 1.2)
|
|
connections. By default only the body is printed.
|
|
|
|
In URL mode, the scheme (http:// or https://) determines whether
|
|
TLS is used. The port defaults to 80 for HTTP and 443 for HTTPS.
|
|
|
|
In legacy mode, the host and port are specified as separate
|
|
arguments and the connection is always plain HTTP.
|
|
|
|
The host may be an IP address or a hostname. Hostnames are
|
|
resolved via the configured DNS server.
|
|
|
|
If no path is given, "/" is used.
|
|
|
|
<strong>OPTIONS</strong>
|
|
<strong>-v</strong>
|
|
Verbose mode. Print connection info, trust anchor count, TLS
|
|
handshake progress, and the HTTP status/size header before
|
|
the body.
|
|
|
|
<strong>EXAMPLES</strong>
|
|
fetch https://icanhazip.com
|
|
Print your public IP address over HTTPS.
|
|
|
|
fetch http://icanhazip.com
|
|
Same, but over plain HTTP.
|
|
|
|
fetch -v https://example.com
|
|
Fetch a page with verbose output showing:
|
|
Connecting to example.com:443 (HTTPS)...
|
|
Loaded 128 trust anchors
|
|
TLS handshake...
|
|
TLS connection established
|
|
GET /
|
|
HTTP 200 OK (1256 bytes)
|
|
|
|
fetch 10.0.68.1 80 /
|
|
Fetch from a local server by IP (legacy syntax).
|
|
|
|
<strong>TLS SUPPORT</strong>
|
|
HTTPS connections use BearSSL for TLS 1.2. Server certificates
|
|
are validated against the system CA bundle at
|
|
0:/os/certs/ca-certificates.crt.
|
|
|
|
Entropy for the TLS handshake is provided by RDTSC-seeded
|
|
random data via the SYS_GETRANDOM syscall.
|
|
|
|
<strong>KEYBOARD</strong>
|
|
Ctrl+Q Abort the request
|
|
|
|
<strong>SEE ALSO</strong>
|
|
ping(1), nslookup(1), tcpconnect(1), shell(1), syscalls(2)</code></pre>
|
|
|
|
<hr>
|
|
|
|
<div class="center">
|
|
<a href="../index.html">Back to Documentation Index</a>
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|