Documentation ¶
Overview ¶
package shttp provides glue to use net/http libraries for HTTP over SCION.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&Dialer{ QuicConfig: nil, Policy: nil, }).DialContext, ForceAttemptHTTP2: true, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }
DefaultTransport is the default RoundTripper that can be used for HTTP over SCION/QUIC. This is equivalent to net/http.DefaultTransport with DialContext overridden to use shttp.Dialer, which dials connections over SCION/QUIC.
Functions ¶
func ListenAndServe ¶
ListenAndServe listens for HTTP connections on the SCION address addr and calls Serve with handler to handle requests
func ListenAndServeTLS ¶ added in v0.4.0
ListenAndServe listens for HTTPS connections on the SCION address addr and calls Serve with handler to handle requests
func MangleSCIONAddrURL ¶
MangleSCIONAddrURL mangles a SCION address in the host part of a URL-ish string so that it can be safely used as a URL, i.e. it can be parsed by net/url.Parse
Types ¶
type Dialer ¶ added in v0.4.0
type Dialer struct { Local netaddr.IPPort QuicConfig *quic.Config Policy pan.Policy // contains filtered or unexported fields }
Dialer dials an insecure, single-stream QUIC connection over SCION (just pretend it's TCP). This is the Dialer used for shttp.DefaultTransport.
func NewTransport ¶ added in v0.5.0
NewTransport creates a new RoundTripper that can be used for HTTP over SCION/QUIC, providing a custom QuicConfig and Policy to the Dialer. This equivalent to net/http.DefaultTransport with an overridden DialContext. Both the Transport and the Dialer are returned, as the Dialer is not otherwise accessible from the Transport.
func (*Dialer) DialContext ¶ added in v0.4.0
DialContext dials an insecure, single-stream QUIC connection over SCION. This can be used as the DialContext function in net/http.Transport.
type Server ¶
Server wraps a http.Server making it work with SCION
func (*Server) ListenAndServe ¶
ListenAndServe listens for QUIC connections on srv.Addr and calls Serve to handle incoming requests