def proxy.route.connected
bend-kit-http@0.38.2.0 · http.bend:3502
import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-wire@0.4.7.0/wire.bend as Wire
3502def proxy.route.connected(tls: Bool, +ms: U32, sni: String, authority: String,
3503 authorization: String, cert: Maybe<&2, Cert>, +ca: String,
3504 r: Result<&1, &1, Err, Conn>) -> IO(Result<&1, &1, Err, Conn>):
3505 match r:
3506 case Fail{e}:
3507 IO.pure(Result<&1, &1, Err, Conn>, Fail{e})
3508 case Done{c}:
3509 match c:
3510 case Conn{plain, s}:
3511 proxy.route.tls(tls, s, ms, sni, authority, authorization, cert, ca)
3512 case ConnH2{s, client}:
3513 do IO<Result<&1, &1, Err, Conn>>:
3514 Wire.tls.close(s)
3515 return Fail{ErrBad{}}