(close! t)(close! t reason)Closes a tunnel opened by connect!: sends bye (reason client closed, or
the given reason) and releases the socket. The state map is immutable, so
closing the same tunnel twice is a no-op (the reason of the first close wins).
Closes a tunnel opened by connect!: sends `bye` (reason `client closed`, or the given reason) and releases the socket. The state map is immutable, so closing the same tunnel twice is a no-op (the reason of the first close wins).
(close-reason t)Reason carried by the bye that closed the tunnel ("" while open).
Reason carried by the bye that closed the tunnel ("" while open).
(closed? t)True once close! ran (with any reason) or the socket is gone.
True once close! ran (with any reason) or the socket is gone.
(connect! server
local
&
{:keys [token subdomain resume routes edge-probe-interval
edge-probe-url]})Connects to the etunnel server exposing the local service at local ("127.0.0.1:3000" or a port number). Blocks until the server's welcome (15s timeout) and returns the state map with :url, :hostname, :ws, :resume-token and :close! - a plain map, so (:url t) / (close! t), no deref. Edge probe (PROTOCOL.md 3a): :edge-probe-interval (ms; nil/0 = 60s default, negative disables) and :edge-probe-url (override base URL; probed under its own host - java.net.http forbids setting Host). The result is exposed via (edge-state t) / (:edge-state t) - an atom holding :unknown|:ok|:unreachable - and (close-reason t); two consecutive 'edge does not know this tunnel' answers close the tunnel with reason "edge lost tunnel".
Connects to the etunnel server exposing the local service at local
("127.0.0.1:3000" or a port number). Blocks until the server's welcome
(15s timeout) and returns the state map with :url, :hostname, :ws,
:resume-token and :close! - a plain map, so (:url t) / (close! t), no deref.
Edge probe (PROTOCOL.md 3a): :edge-probe-interval (ms; nil/0 = 60s default,
negative disables) and :edge-probe-url (override base URL; probed under its
own host - java.net.http forbids setting Host). The result is exposed via
(edge-state t) / (:edge-state t) - an atom holding :unknown|:ok|:unreachable -
and (close-reason t); two consecutive 'edge does not know this tunnel'
answers close the tunnel with reason "edge lost tunnel".connect! with :edge-probe-interval nil/0 probes this often (ms).
connect! with :edge-probe-interval nil/0 probes this often (ms).
Marks a genuine edge answer (200 or 404); anything without it is unreachable.
Marks a genuine edge answer (200 or 404); anything without it is unreachable.
Probe path answered by the edge itself (literal mirror of the server's).
Probe path answered by the edge itself (literal mirror of the server's).
Bounds one probe request (ms).
Bounds one probe request (ms).
(edge-state t)Result of the most recent edge probe for tunnel map t (PROTOCOL.md 3a): :unknown (no probe completed / probing disabled), :ok, or :unreachable. Also readable as @(:edge-state t).
Result of the most recent edge probe for tunnel map t (PROTOCOL.md 3a): :unknown (no probe completed / probing disabled), :ok, or :unreachable. Also readable as @(:edge-state t).
(etunnel-login! server)(etunnel-login! server open-browser timeout-secs)CLI loopback login. Binds a random 127.0.0.1 port, opens the browser (prints the URL when headless), waits for the one-time code (10-minute budget), exchanges it. open-browser is an optional (fn [url]).
CLI loopback login. Binds a random 127.0.0.1 port, opens the browser (prints the URL when headless), waits for the one-time code (10-minute budget), exchanges it. open-browser is an optional (fn [url]).
(login-post! url body)POST body (map) as JSON to url; returns the decoded JSON map.
POST body (map) as JSON to url; returns the decoded JSON map.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |