masque

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDialer

func NewDialer(opts ...dialer.Option) dialer.Dialer

Types

type Client

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

Client manages HTTP/3 connections for MASQUE proxying. It wraps a QUIC connection and HTTP/3 client, following the session pattern used by other tnet dialers (ssh, quic, mws, etc.).

func (*Client) Close

func (c *Client) Close() error

Close closes the client connection.

func (*Client) Dial

func (c *Client) Dial(ctx context.Context, addr string) (net.Conn, error)

Dial establishes an HTTP/3 connection to the proxy server. It returns a MasqueConn that can be used by the MASQUE connector. Following the QUIC dialer pattern, this opens a request stream immediately to detect dead connections and allow cache invalidation.

func (*Client) IsClosed

func (c *Client) IsClosed() bool

IsClosed returns true if the underlying connection is closed. This follows the pattern used by other tnet session wrappers.

type MasqueConn

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

MasqueConn wraps an HTTP/3 client connection for use with the MASQUE connector. It implements net.Conn for compatibility with the tnet connector interface, but the actual data transfer happens via datagrams through the pre-opened RequestStream.

func (*MasqueConn) Close

func (c *MasqueConn) Close() error

Close closes the connection.

func (*MasqueConn) GetHost

func (c *MasqueConn) GetHost() string

GetHost returns the proxy host.

func (*MasqueConn) GetRequestStream

func (c *MasqueConn) GetRequestStream() *http3.RequestStream

GetRequestStream returns the pre-opened HTTP/3 request stream. The connector uses this for the CONNECT-UDP handshake.

func (*MasqueConn) LocalAddr

func (c *MasqueConn) LocalAddr() net.Addr

LocalAddr returns the local network address.

func (*MasqueConn) OpenRequestStream

func (c *MasqueConn) OpenRequestStream(ctx context.Context) (*http3.RequestStream, error)

OpenRequestStream opens another request stream on the shared HTTP/3 connection. CONNECT-UDP associations use one stream per destination.

func (*MasqueConn) Read

func (c *MasqueConn) Read(b []byte) (n int, err error)

Read implements net.Conn but is not used for MASQUE. The actual data transfer happens via datagrams or the request stream.

func (*MasqueConn) RemoteAddr

func (c *MasqueConn) RemoteAddr() net.Addr

RemoteAddr returns the remote network address.

func (*MasqueConn) SetDeadline

func (c *MasqueConn) SetDeadline(t time.Time) error

SetDeadline sets the read and write deadlines.

func (*MasqueConn) SetReadDeadline

func (c *MasqueConn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read deadline.

func (*MasqueConn) SetWriteDeadline

func (c *MasqueConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the write deadline.

func (*MasqueConn) Write

func (c *MasqueConn) Write(b []byte) (n int, err error)

Write implements net.Conn but is not used for MASQUE. The actual data transfer happens via datagrams or the request stream.

Jump to

Keyboard shortcuts

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