protocol

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PakePayload

type PakePayload struct {
	Bytes []byte `json:"pake_bytes"`
}

type PasswordPayload

type PasswordPayload struct {
	Password string `json:"password"`
}

type ReceiverHandshakePayload

type ReceiverHandshakePayload struct {
	IP net.IP `json:"ip"`
}

type SaltPayload

type SaltPayload struct {
	Salt []byte `json:"salt"`
}

type SenderHandshakePayload

type SenderHandshakePayload struct {
	IP          net.IP `json:"ip"`
	Port        int    `json:"port"`
	PayloadSize int64  `json:"payload_size"`
}

SenderHandshakePayload specifies a payload type for announcing the payload size.

type TransferMessage

type TransferMessage struct {
	Type    TransferMessageType `json:"type"`
	Payload interface{}         `json:"payload,omitempty"`
}

TransferMessage specifies a message in the transfer protocol.

func (TransferMessage) Bytes

func (t TransferMessage) Bytes() []byte

type TransferMessageType

type TransferMessageType int

TransferMessageType specifies the message type for the messages in the transfer protocol.

const (
	TransferError     TransferMessageType = iota // An error has occured in transferProtocol
	ReceiverHandshake                            // Receiver exchange its IP via the tranx server to the sender
	SenderHandshake                              // Sender exchanges IP, port and payload size to the receiver via the tranx server
	ReceiverDirectCommunication
	SenderDirectAck            // Sender ACKs the request for direct communication
	ReceiverRelayCommunication // Receiver has tried to probe the sender but cannot find it on the subnet, relay communication will be used
	SenderRelayAck             // Sender ACKs the request for relay communication
	ReceiverRequestPayload     // Receiver request the payload from the sender
	SenderPayloadSent          // Sender announces that the entire file has been transfered
	ReceiverPayloadAck         // Receiver ACKs that is has received the payload
	SenderClosing              // Sender announces that it is closing the connection
	ReceiverClosingAck         // Receiver ACKs the closing of the connection
)

func (TransferMessageType) Name

func (t TransferMessageType) Name() string

type TranxClient

type TranxClient struct {
	Conn *websocket.Conn
	IP   net.IP
}

type TranxMessage

type TranxMessage struct {
	Type    TranxMessageType `json:"type"`
	Payload interface{}      `json:"payload"`
}

type TranxMessageType

type TranxMessageType int
const (
	TranxToSenderBind        TranxMessageType = iota // An ID for this connection is bound and communicated
	SenderToTranxEstablish                           // Sender has generated and hashed password
	ReceiverToTranxEstablish                         // Passsword has been communicated to receiver who has hashed it
	TranxToSenderReady                               // Tranx announces to sender that receiver is connected
	SenderToTranxPAKE                                // Sender sends PAKE information to tranx
	TranxToReceiverPAKE                              // Tranx forwards PAKE information to receiver
	ReceiverToTranxPAKE                              // Receiver sends PAKE information to tranx
	TranxToSenderPAKE                                // Tranx forwards PAKE information to receiver
	SenderToTranxSalt                                // Sender sends cryptographic salt to tranx
	TranxToReceiverSalt                              // Rendevoux forwards cryptographic salt to receiver
	ReceiverToTranxClose                             // Receiver can connect directly to sender, close receiver connection -> close sender connection
	SenderToTranxClose                               // Transit sequence is completed, close sender connection -> close receiver connection
)

type TranxReceiver

type TranxReceiver = TranxClient

type TranxSender

type TranxSender struct {
	TranxClient
	Port int
}

type TranxToSenderBindPayload

type TranxToSenderBindPayload struct {
	ID int `json:"id"`
}

type WrongMessageTypeError

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

func NewWrongMessageTypeError

func NewWrongMessageTypeError(expected []TransferMessageType, got TransferMessageType) *WrongMessageTypeError

func (*WrongMessageTypeError) Error

func (e *WrongMessageTypeError) Error() string

Jump to

Keyboard shortcuts

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