protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID          = "/p2pdao/libp2p-proxy/1.0.0"
	ServiceName = "p2pdao.libp2p-proxy"
)

Variables

View Source
var Log = logging.Logger("libp2p-proxy")

Functions

func HttpHandler

func HttpHandler(bs *BufReaderStream)

func IsSocks5

func IsSocks5(v byte) bool

func Socks5Handler

func Socks5Handler(bs *BufReaderStream)

Types

type ACLFilter

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

func NewACL

func NewACL(cfg config.ACLConfig) (*ACLFilter, error)

func (*ACLFilter) Allow

func (a *ACLFilter) Allow(p peer.ID, addr ma.Multiaddr) bool

type BufReaderStream

type BufReaderStream struct {
	network.Stream
	*bufio.Reader
}

func NewBufReaderStream

func NewBufReaderStream(s network.Stream) *BufReaderStream

func (*BufReaderStream) Read

func (bs *BufReaderStream) Read(p []byte) (int, error)

type ProxyService

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

func NewProxyService

func NewProxyService(ctx context.Context, h host.Host, acl *ACLFilter) *ProxyService

func (*ProxyService) Handler

func (p *ProxyService) Handler(s network.Stream)

func (*ProxyService) Serve

func (p *ProxyService) Serve(proxyAddr string, remotePeer peer.ID) error

func (*ProxyService) Wait

func (p *ProxyService) Wait(fn func() error) error

Jump to

Keyboard shortcuts

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