1 # ezhttp/src/wirespec: the text the wire effect reads, pure. Kept apart from 2 # wire.bend (the effect) so the proof gate can import it. 3 # 4 # Spec: scheme, host, port each on their own line; everything after the third 5 # newline is the request verbatim. 6 import Base 7 8 # the word the effect reads for a scheme that wants TLS 9 def wire.scheme(secure: Bool) -> String: 10 match secure: 11 case True{}: 12 "tls" 13 case False{}: 14 "tcp" 15 16 # the spec the effect reads 17 def wire.spec(secure: Bool, host: String, port: U32, req: String) -> String: 18 wire.scheme(secure) ++ "\n" ++ host ++ "\n" ++ U32.show(port) ++ "\n" ++ req