masque

package module
v0.0.0-...-31c76df Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 19 Imported by: 0

README

masque-go

PkgGoDev Code Coverage

masque-go is an implementation of the CONNECT-UDP protocol RFC 9298, based on quic-go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Template is the URI template of the UDP proxy.
	Template *uritemplate.Template

	// TLSClientConfig is the TLS client config used when dialing the QUIC connection to the proxy.
	// It must set the h3 ALPN.
	TLSClientConfig *tls.Config

	// QUICConfig is the QUIC config used when dialing the QUIC connection.
	QUICConfig *quic.Config
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialIP

func (c *Client) DialIP(ctx context.Context, raddr *net.UDPAddr) (net.PacketConn, error)

type Proxy

type Proxy struct {
	http3.Server

	// Template is the URI template that clients will use to configure this UDP proxy.
	Template *uritemplate.Template

	// Allow determines if a proxying request from a client is allowed to proceed.
	// It is called after the requested target address has been resolved.
	Allow func(context.Context, *net.UDPAddr) bool

	// DialTarget is called when the proxy needs to open a new UDP socket to the target server.
	// It must return a connected UDP socket.
	// TODO(#3): support unconnected sockets.
	DialTarget func(*net.UDPAddr) (*net.UDPConn, error)
	// contains filtered or unexported fields
}

func (*Proxy) Close

func (s *Proxy) Close() error

func (*Proxy) Upgrade

func (s *Proxy) Upgrade(w http.ResponseWriter, r *http.Request) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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