Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type H2Transport ¶
type H2Transport struct { // Event handlers will be copied to all created Mux and streams // It is possible to add more to each individual mux/stream h2.Events // Accepted reverse connections H2RConn map[*h2.H2Transport]*ugate.EndpointCon H2RCallback func(string, *h2.H2Transport) // contains filtered or unexported fields }
func (*H2Transport) BlockingServerConn ¶
func (t *H2Transport) BlockingServerConn(conn net.Conn, mux *http.ServeMux)
StartH2ServerConn will initiate an H2 server on the netConn.
func (*H2Transport) DialH2R ¶
func (t *H2Transport) DialH2R(ctx context.Context, hc *ugate.EndpointCon, addr string) error
- H2R Server accepts mTLS connection from client, using h2r ALPN - Client opens a H2 _server_ handler on the stream, H2R server acts as a H2 client. - EndpointCon is registered in k8s, using IP of the server holding the connection - SNI requests on the H2R server are routed to existing connection - if a connection is not found on local server, forward based on endpoint. DialH2R connects to an H2R tunnel endpoint, and accepts connections from the tunnel Not blocking.
func (*H2Transport) FindMux ¶
func (t *H2Transport) FindMux(ctx context.Context, c *ugate.MeshCluster) (*ugate.EndpointCon, error)
findMux - find an EndpointCon that is able to accept new connections. Will also dial a connection as needed, and verify the mux can accept a new connection. LB should happen here. WIP: just one, no retry, only for testing. TODO: implement LB properly
type HBoneAcceptedConn ¶
type HBoneAcceptedConn struct {
// contains filtered or unexported fields
}
HBoneAcceptedConn keeps track of one accepted H2 connection.
func (*HBoneAcceptedConn) ServeHTTP ¶
func (hac *HBoneAcceptedConn) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the basic TCP-over-H2 and H2 proxy protocol. Requests that are not UGate will be handled by the mux in UGate, and if they don't match a handler may be forwarded by the reverse HTTP proxy.