ytl

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Overview

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyFromOptionalKey

func KeyFromOptionalKey(key ed25519.PrivateKey) ed25519.PrivateKey

Types

type ConnManager

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

func NewConnManager

func NewConnManager(
	ctx context.Context,
	key ed25519.PrivateKey,
	proxy *ProxyManager,
	dm *DeduplicationManager,
	allowList *static.AllowList,
) *ConnManager

func NewConnManagerWithTransports

func NewConnManagerWithTransports(
	ctx context.Context,
	key ed25519.PrivateKey,
	proxy *ProxyManager,
	dm *DeduplicationManager,
	allowList *static.AllowList,
	transports []static.Transport,
) *ConnManager

func (*ConnManager) Connect

func (c *ConnManager) Connect(uri url.URL) (*YggConn, error)

func (*ConnManager) ConnectCtx

func (c *ConnManager) ConnectCtx(ctx context.Context, uri url.URL) (*YggConn, error)

func (*ConnManager) ConnectTimeout

func (c *ConnManager) ConnectTimeout(uri url.URL, timeout time.Duration) (*YggConn, error)

func (*ConnManager) Listen

func (c *ConnManager) Listen(uri url.URL) (ygg YggListener, err error)

type DeduplicationManager

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

func NewDeduplicationManager

func NewDeduplicationManager(secureMode bool, blockKey ed25519.PublicKey) *DeduplicationManager

func (*DeduplicationManager) Check

func (d *DeduplicationManager) Check(key ed25519.PublicKey, isSecure uint, closeMethod func()) func()

type ProxyManager

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

func NewProxyManager

func NewProxyManager(defaultProxy *url.URL, mapping []ProxyMapping) ProxyManager

func (*ProxyManager) Get

func (p *ProxyManager) Get(uri url.URL) *url.URL

type ProxyMapping

type ProxyMapping struct {
	HostRegexp regexp.Regexp
	Proxy      *url.URL
}

type YggConn

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

func ConnToYggConn

func ConnToYggConn(conn net.Conn, transport_key ed25519.PublicKey, allow *static.AllowList, secureTranport uint, dm *DeduplicationManager) *YggConn

func (*YggConn) Close

func (y *YggConn) Close() (err error)

func (*YggConn) GetPublicKey

func (y *YggConn) GetPublicKey() (ed25519.PublicKey, error)

func (*YggConn) GetVer

func (y *YggConn) GetVer() (*static.ProtoVersion, error)

func (*YggConn) LocalAddr

func (y *YggConn) LocalAddr() net.Addr

func (*YggConn) Read

func (y *YggConn) Read(b []byte) (n int, err error)

func (*YggConn) RemoteAddr

func (y *YggConn) RemoteAddr() net.Addr

func (*YggConn) SetDeadline

func (y *YggConn) SetDeadline(t time.Time) (err error)

func (*YggConn) SetReadDeadline

func (y *YggConn) SetReadDeadline(t time.Time) (err error)

func (*YggConn) SetWriteDeadline

func (y *YggConn) SetWriteDeadline(t time.Time) (err error)

func (*YggConn) Write

func (y *YggConn) Write(b []byte) (n int, err error)

type YggListener

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

func (*YggListener) Accept

func (y *YggListener) Accept() (ygg YggConn, err error)

Accept waits for and returns the next connection to the listener.

func (*YggListener) Addr

func (y *YggListener) Addr() net.Addr

Addr returns the listener's network address.

func (*YggListener) Close

func (y *YggListener) Close() error

Close closes the listener. Any blocked Accept operations will be unblocked and return errors.

Directories

Path Synopsis
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>
Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

Jump to

Keyboard shortcuts

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