tinyss

package
v0.19.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Socket

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

Socket represents a TinySS connection; it implements net.Conn but with more methods.

func Handshake

func Handshake(plain net.Conn, nextProtocol byte) (sok *Socket, err error)

Handshake upgrades a plaintext socket to a MiniSS socket, given our secret key.

func (*Socket) Close

func (sk *Socket) Close() error

Close closes the socket.

func (*Socket) LocalAddr

func (sk *Socket) LocalAddr() net.Addr

LocalAddr returns the local address.

func (*Socket) NextProt added in v0.12.0

func (sk *Socket) NextProt() byte

NextProt returns the "next protocol" signal given by the remote.

func (*Socket) Read

func (sk *Socket) Read(p []byte) (n int, err error)

Read reads into the given byte slice.

func (*Socket) RemoteAddr

func (sk *Socket) RemoteAddr() net.Addr

RemoteAddr returns the remote address.

func (*Socket) SetDeadline

func (sk *Socket) SetDeadline(t time.Time) error

SetDeadline sets the deadline.

func (*Socket) SetReadDeadline

func (sk *Socket) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read deadline.

func (*Socket) SetWriteDeadline

func (sk *Socket) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the write deadline.

func (*Socket) SharedSec

func (sk *Socket) SharedSec() []byte

SharedSec returns the shared secret. Use this to authenticate the connection (through signing etc).

func (*Socket) Write

func (sk *Socket) Write(p []byte) (n int, err error)

Write writes out the given byte slice. No guarantees are made regarding the number of low-level segments sent over the wire.

Jump to

Keyboard shortcuts

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