cmuxMatch

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

cmux match

基于 github.com/soheilhy/cmux 实现的动态添加协议的 match管理器

用法

package main

import cmuxMatch "github.com/eolinker/eosc/traffic/cmux-match"
	match := cmuxMatch.NewMatch(listener)
	h1l:=match.Match(cmuxMatch.Http1)
	wslmatch.Match(cmuxMatch.Websocket)
	wslmatch.Match(cmuxMatch.GRPC)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorListenerClosed = cmux.ErrListenerClosed
)

Functions

This section is empty.

Types

type CMuxMatch

type CMuxMatch interface {
	Match(match MatchType) net.Listener
	SetReadTimeout(time.Duration)
	Close() error
}

func NewMatch

func NewMatch(l net.Listener) CMuxMatch

type ListenerProxy

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

func NewListenerProxy

func NewListenerProxy(l net.Listener, shutDown chan struct{}) *ListenerProxy

func (*ListenerProxy) Accept

func (l *ListenerProxy) Accept() (net.Conn, error)

func (*ListenerProxy) Addr

func (l *ListenerProxy) Addr() net.Addr

func (*ListenerProxy) Close

func (l *ListenerProxy) Close() error

func (*ListenerProxy) Replace

func (l *ListenerProxy) Replace() *ListenerProxy

func (*ListenerProxy) ShutDown

func (l *ListenerProxy) ShutDown()

type MatchType

type MatchType int
const (
	Any MatchType = iota
	Http1
	Https
	Http2
	Websocket
	GRPC
)

func (MatchType) String

func (t MatchType) String() string

Jump to

Keyboard shortcuts

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