h2r

package module
v0.0.0-...-af1ce48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type H2R

type H2R struct {
	// contains filtered or unexported fields
}

func New

func New(ug *ugatesvc.UGate) *H2R

func (*H2R) DialMux

func (t *H2R) DialMux(ctx context.Context, dm *ugate.DMNode, meta http.Header, ev func(t string, stream *ugate.Stream)) (ugate.Muxer, error)

DialMUX creates one connection to a mesh node, using one of the supported multiplex protocols.

func (*H2R) HandleH2R

func (t *H2R) HandleH2R(w http.ResponseWriter, r *http.Request)

HandleH2R takes a POST "/h2r/" request and set the stream as a H2 client connection.

It will start by sending a test "id" request, and associate the muxed connection to the node.

Blocks until str.Close().

type H2RMux

type H2RMux struct {
	*http2.ClientConn
	// contains filtered or unexported fields
}

H2RMux is a mux using H2 frames. Based on ALPN, may use raw frames.

func (*H2RMux) NewStream

func (c *H2RMux) NewStream(ctx context.Context, req *http.Request) (*H2Stream, error)

NewStream opens a H2 stream. No H2 header (empty) - this matches QUIC streams

type H2Stream

type H2Stream struct {

	// Callback style - if set dataChan and Read will not be used. Not blocking
	DataHandlerNB func(*http2.DataFrame) error
	// contains filtered or unexported fields
}

H2Stream is a multiplexed stream.

func (*H2Stream) Close

func (str *H2Stream) Close() error

func (*H2Stream) Read

func (str *H2Stream) Read(p []byte) (n int, err error)

func (*H2Stream) Write

func (str *H2Stream) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL