src/proxy.bend checks
raw source on the hub · import bend-kube-runtime@0.10.0.0/src/proxy.bend as Proxy
4 imports
import Base import ./utf8.bend as U import ./base64.bend as B import ./config.bend as K
Types
type Proxy source · line 18 · raw
Data
Proxy@host:String -> @port:U32 -> @auth:String -> Proxy
type Route source · line 22 · raw
Data
auth is the Basic credential (base64 of "user:password"), "" for none.
DirectRoute
Via@proxy:Proxy -> Route
NoRoute@why:String -> Route
type Ent source · line 118 · raw
Data
An entry, split from its port ("" for any).
Ent@host:String -> @port:String -> Ent
type Tunnel source · line 343 · raw
Data
TMore@head:List<&2, U32> -> Tunnel
TOpenTunnel
TFail@why:String -> Tunnel
Definitions
def Ip4.octet.if source · line 30 · raw
@+v:U32 -> @ok:Bool -> Maybe<&2, U32>
def Ip4.octet.go source · line 37 · raw
@m:Maybe<&2, U32> -> Maybe<&2, U32>
def Ip4.octet source · line 44 · raw
@s:String -> Maybe<&2, U32>
def Ip4.join source · line 47 · raw
@a:Maybe<&2, U32> -> @b:Maybe<&2, U32> -> @c:Maybe<&2, U32> -> @d:Maybe<&2, U32> -> Maybe<&2, U32>
def Ip4.parse.go source · line 55 · raw
@ps:List<&2, String> -> Maybe<&2, U32>
def Ip4.parse source · line 63 · raw
@s:String -> Maybe<&2, U32>
"10.1.2.3" as a number, if it is a dotted IPv4 address.
def Ip4.is_loopback source · line 66 · raw
@m:Maybe<&2, U32> -> Bool
def Ip4.mask.go source · line 74 · raw
@+bits:U32 -> @ok:Bool -> Maybe<&2, U32>
The mask of a prefix length; None past 32.
def Ip4.mask source · line 81 · raw
@+bits:U32 -> Maybe<&2, U32>
def Ip4.in source · line 84 · raw
@h:Maybe<&2, U32> -> @n:Maybe<&2, U32> -> @m:Maybe<&2, U32> -> Bool
def Ip4.mask.of source · line 91 · raw
@m:Maybe<&2, U32> -> Maybe<&2, U32>
def Ip4.cidr.go source · line 98 · raw
@h:String -> @parts:List<&2, String> -> Bool
def Ip4.cidr source · line 106 · raw
@h:String -> @block:String -> Bool
Whether IPv4 host h lies in the "net/bits" block.
def Ent.of.go source · line 121 · raw
@parts:List<&2, String> -> @+item:String -> Ent
def Ent.of source · line 128 · raw
@+item:String -> Ent
def NoProxy.star source · line 131 · raw
@e:String -> String
def NoProxy.name.go source · line 138 · raw
@+e:String -> @+host:String -> @dot:Bool -> Bool
def NoProxy.name source · line 145 · raw
@+e:String -> @+host:String -> Bool
def NoProxy.port_ok source · line 148 · raw
@+want:String -> @+port:U32 -> Bool
def NoProxy.ent source · line 151 · raw
@e:Ent -> @+host:String -> @+port:U32 -> Bool
def NoProxy.hit.go source · line 157 · raw
@+host:String -> @+port:U32 -> @+item:String -> @star:Bool -> Bool
def NoProxy.hit source · line 164 · raw
@+host:String -> @+port:U32 -> @+item:String -> Bool
def NoProxy.any source · line 167 · raw
@xs:List<&2, String> -> @+host:String -> @+port:U32 -> Bool
def NoProxy.commas source · line 174 · raw
@s:String -> String
def NoProxy.bypass source · line 184 · raw
@no:String -> @+host:String -> @+port:U32 -> Bool
Whether NO_PROXY (no) sends host:port around the proxy.
def Pct.hex.go source · line 190 · raw
@+c:U32 -> @d:Bool -> @up:Bool -> @low:Bool -> U32
def Pct.hex source · line 202 · raw
@+c:U32 -> U32
A hex digit's value, 16 for any other character.
def Pct.esc.if source · line 206 · raw
@+a:Char -> @+b:Char -> @+hi:U32 -> @+lo:U32 -> @rest:List<&2, U32> -> @ok:Bool -> List<&2, U32>
def Pct.esc source · line 214 · raw
@+a:Char -> @+b:Char -> @rest:List<&2, U32> -> List<&2, U32>
def Pct.decode source · line 221 · raw
@s:String -> List<&2, U32>
The bytes of a percent-encoded URL part ("%40" is '@'); a '%' that starts no escape stays as it is.
def Proxy.parse.fin source · line 230 · raw
@+h:String -> @+p:U32 -> @auth:String -> @empty:Bool -> Route
def Proxy.parse.hp source · line 237 · raw
@hp:Pair(String, U32) -> @auth:String -> Route
def Proxy.parse.at source · line 244 · raw
@rs:List<&2, String> -> Route
The authority's parts split at '@', last first: the host, then the user info (which may itself hold an '@').
def Proxy.parse.auth source · line 254 · raw
@ap:Pair(String, String) -> Route
def Proxy.parse.go source · line 259 · raw
@+u:String -> @http:Bool -> @other:Bool -> Route
def Proxy.parse source · line 270 · raw
@+u:String -> Route
"http://user:pass@host:port", or "host:port" (http:// is assumed, as Go does). Other schemes fail rather than silently connecting directly.
def Proxy.route.url source · line 276 · raw
@+url:String -> @empty:Bool -> Route
def Proxy.route.no source · line 283 · raw
@+url:String -> @by:Bool -> Route
def Proxy.route.local source · line 290 · raw
@+url:String -> @no:String -> @+host:String -> @+port:U32 -> @local:Bool -> Route
def Proxy.is_local source · line 298 · raw
@+host:String -> Bool
def Proxy.route source · line 305 · raw
@+url:String -> @no:String -> @host:String -> @+port:U32 -> Route
How to reach host:port, given HTTPS_PROXY (url) and NO_PROXY (no): localhost and loopback addresses never use a proxy (as in Go), nor do hosts NO_PROXY lists, nor anything when no proxy is set.
def Proxy.target.go source · line 312 · raw
@+h:String -> @+p:U32 -> @v6:Bool -> String
def Proxy.target source · line 319 · raw
@+h:String -> @+p:U32 -> String
def Proxy.auth_line.go source · line 322 · raw
@+auth:String -> @none:Bool -> String
def Proxy.connect source · line 330 · raw
@+host:String -> @+port:U32 -> @+auth:String -> String
The request that opens a tunnel to host:port.
def Tunnel.init source · line 348 · raw
Tunnel
def Tunnel.is_end source · line 351 · raw
@+h:List<&2, U32> -> Bool
def Tunnel.line.if source · line 358 · raw
@+b:U32 -> @rest:List<&2, U32> -> @cr:Bool -> List<&2, U32>
def Tunnel.line source · line 366 · raw
@bs:List<&2, U32> -> List<&2, U32>
The bytes before the first CR.
def Tunnel.verdict.go source · line 373 · raw
@+line:String -> @ok:Bool -> Tunnel
def Tunnel.verdict source · line 380 · raw
@+line:String -> Tunnel
def Tunnel.done source · line 384 · raw
@h:List<&2, U32> -> @rest:List<&2, U32> -> Tunnel
def Tunnel.push source · line 391 · raw
@bs:List<&2, U32> -> @+h:List<&2, U32> -> @end:Bool -> Tunnel
def Tunnel.cap.go source · line 400 · raw
@+h:List<&2, U32> -> @long:Bool -> Tunnel
def Tunnel.cap source · line 407 · raw
@t:Tunnel -> Tunnel
def Tunnel.more source · line 414 · raw
@+h:List<&2, U32> -> @bs:List<&2, U32> -> @closed:Bool -> Tunnel
def Tunnel.feed source · line 422 · raw
@t:Tunnel -> @+bs:List<&2, U32> -> Tunnel
The tunnel after the next bytes of the answer; no bytes is the end.