Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.gateway.server.proxy

The forward proxy of the gateway (gateway.proxy in the global configuration).

A paired client, for example the Companion app on a phone outside a company VPC, opens the hosts of allowed_domains through the network of the gateway machine. The listener is the egress proxy of the sandbox (sandbox.egress-proxy) on its own port of the gateway host, so HTTPS CONNECT, plain HTTP and SOCKS5 all work.

Rules:

  • Only the global configuration turns the proxy on. A project vis.yml cannot, because a cloned repository must never open the network of the machine.
  • Each connection must send the gateway token as the user name of Proxy-Authorization: Basic, also on a loopback bind. A jailed child has no token, and the proxy port is a reserved loopback port, so the proxy is no escape from a jail.
  • Private addresses are allowed (a VPC is private). Link-local and cloud metadata addresses stay blocked, and so do the ports of the gateway and of the proxy.
  • Each connection reads the configuration again, so a domain change needs no restart. sync! starts, moves or stops the listener.
The forward proxy of the gateway (`gateway.proxy` in the global configuration).

A paired client, for example the Companion app on a phone outside a company VPC,
opens the hosts of `allowed_domains` through the network of the gateway machine.
The listener is the egress proxy of the sandbox (`sandbox.egress-proxy`) on its own
port of the gateway host, so HTTPS `CONNECT`, plain HTTP and SOCKS5 all work.

Rules:
- Only the global configuration turns the proxy on. A project `vis.yml` cannot,
  because a cloned repository must never open the network of the machine.
- Each connection must send the gateway token as the user name of
  `Proxy-Authorization: Basic`, also on a loopback bind. A jailed child has no token,
  and the proxy port is a reserved loopback port, so the proxy is no escape from a jail.
- Private addresses are allowed (a VPC is private). Link-local and cloud metadata
  addresses stay blocked, and so do the ports of the gateway and of the proxy.
- Each connection reads the configuration again, so a domain change needs no
  restart. `sync!` starts, moves or stops the listener.
raw docstring

default-portsclj

The target ports when gateway.proxy.ports is absent.

The target ports when `gateway.proxy.ports` is absent.
sourceraw docstring

handlersclj

source

policyclj

(policy settings token expected-token reserved-ports)

The egress policy of one connection that presented token. settings nil gives a refusal, a wrong token a 407 answer, else the policy of the allowed domains. The answer is never nil: the egress proxy reads a nil policy as open every host.

The egress policy of one connection that presented `token`. `settings` nil gives a
refusal, a wrong token a 407 answer, else the policy of the allowed domains. The
answer is never nil: the egress proxy reads a nil policy as `open every host`.
sourceraw docstring

settingsclj

(settings raw)

The proxy settings of the string-keyed configuration raw, or nil when the proxy is off: {:allowed-domains [...] :denied-domains [...] :ports [...] :port n-or-nil}.

The proxy settings of the string-keyed configuration `raw`, or nil when the proxy is
off: `{:allowed-domains [...] :denied-domains [...] :ports [...] :port n-or-nil}`.
sourceraw docstring

stop!clj

(stop!)

Stop the listener. Idempotent.

Stop the listener. Idempotent.
sourceraw docstring

sync!clj

(sync!)

Make the listener match gateway.proxy: start it, move it to a new port, or stop it. A repeated call changes nothing. Returns the port, or nil when the proxy is off.

Make the listener match `gateway.proxy`: start it, move it to a new port, or stop it.
A repeated call changes nothing. Returns the port, or nil when the proxy is off.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close