connecteth

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

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 15 Imported by: 0

README

Proxying Ethernet over HTTP

Go Reference Go CodeFactor Maintainability codecov

connect-eth-go is an implementation of the draft-ietf-masque-connect-ethernet, allowing the proxying of Ethernet frames via QUIC and HTTP/3. It is actually updated to version 10 of the draft.

The project is entirely based on quic-go, and provides both a client and a proxy implementation. Dockerized versions of client, proxy, and server are provided under the examples directory.

At this point, it supports the following use cases:

It still does not support VLAN identifiers (VLANs are supported but not managed by the proxy). Check captures under the pcaps directory to verify compliance with the draft.

License

Distributed under the MIT License — see LICENSE.

Acknowledgements

This project is based in part on connect-ip-go and masque-go, both licensed under the MIT License by Marten Seeman. The original source code has been modified and adapted for this project.

Contributing

Bug reports and pull requests are welcome.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseError

type CloseError struct {
	Remote bool
}

func (*CloseError) Error

func (e *CloseError) Error() string

func (*CloseError) Is

func (e *CloseError) Is(target error) bool

type Conn

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

Conn is a connection structure used to proxy Ethernet frames over HTTP/3.

func Dial

func Dial(ctx context.Context, conn *http3.ClientConn, template *uritemplate.Template) (*Conn, *http.Response, error)

Dial starts a connection to a target Ethernet proxy (Sec. 4.4, 8)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ReadPacket

func (c *Conn) ReadPacket(b []byte) (n int, err error)

ReadPacket reads an Ethernet frame over the HTTP/3 connection.

func (*Conn) WritePacket

func (c *Conn) WritePacket(b []byte) (err error)

WritePacket encapsulates and sends an Ethernet frame over the HTTP/3 connection.

type Proxy

type Proxy struct{}

func (*Proxy) Proxy

func (s *Proxy) Proxy(w http.ResponseWriter, _ *Request) (*Conn, error)

type Request

type Request struct{}

Request is the parsed CONNECT-ETHERNET request returned from ParseRequest. It currently doesn't have any fields (it could have VLAN id or other ones)

func ParseRequest

func ParseRequest(r *http.Request, template *uritemplate.Template) (*Request, error)

ParseRequest parses a CONNECT-ETHERNET request. The template is one of the URI template defined in Sec. 3

type RequestParseError

type RequestParseError struct {
	HTTPStatus int
	Err        error
}

RequestParseError is returned from ParseRequest if parsing the CONNECT-ETHERNET request fails. It is recommended that the request is rejected with the corresponding HTTP status code.

func (*RequestParseError) Error

func (e *RequestParseError) Error() string

func (*RequestParseError) Unwrap

func (e *RequestParseError) Unwrap() error

Jump to

Keyboard shortcuts

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