listenermux

package
v1.3.15 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package listenermux shares a TCP listener between plaintext HTTP/1 and native gRPC. HTTP/2 connections and TLS handshakes are passed unchanged to gRPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

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

Mux owns a listener and any connections not yet handed to a protocol server. Close leaves handed-off connections open for those servers to drain. This is connection-level routing: HTTP/2 REST and HTTPS are not supported.

func New

func New(listener net.Listener) (*Mux, error)

func (*Mux) Close

func (m *Mux) Close() error

func (*Mux) GRPCListener

func (m *Mux) GRPCListener() net.Listener

func (*Mux) HTTPListener

func (m *Mux) HTTPListener() net.Listener

func (*Mux) Serve

func (m *Mux) Serve(ctx context.Context) error

Serve must be called exactly once. It waits for classifiers on exit.

Jump to

Keyboard shortcuts

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