proxcom

package
v0.0.0-...-49ee127 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSocketChannelCreatePacket

func BuildSocketChannelCreatePacket(source ChannelMember, sink ChannelMember, rule ForwardingRule) (*proxy.Packet, string, error)

BuildSocketChannelCreatePacket builds a new packet for creating a socket channel The client sends this to the proxy server to request a new socket channel be setup to link the source and sink @param source: the source channel member @param sink: the sink channel member @param rule: the forwarding rule to use for the channel @return: the new packet, the request id, and an error if one occurred

func NewCriticalErrorPacket

func NewCriticalErrorPacket(err error) *proxy.Packet

func NewDisconnectSocketChannelPacket

func NewDisconnectSocketChannelPacket(id string) (*proxy.Packet, error)

NewDisconnectSocketChannelPacket creates a new packet for disconnecting a socket channel The client sends this to the proxy server to request a socket channel be disconnected @param id: the id of the channel to disconnect @return: the new packet or an error if one occurred

func NewErrorPacket

func NewErrorPacket(err error) *proxy.Packet

Types

type ChannelMember

type ChannelMember struct {
	Id              uuid.UUID
	Name            string
	ForwardingRules []*ForwardingRule
}

Member of a channel. Used to keep track of who is in the channel and where messages can be sent.

func NewChannelMember

func NewChannelMember(name string) *ChannelMember

NewChannelMember creates a new channel member @param name: the name of the channel member

type ChannelStateInfo

type ChannelStateInfo struct {
	YourId         uuid.UUID
	CurrentMembers []*ChannelMember
}

type CreateSocketChannelPacket

type CreateSocketChannelPacket struct {
	Id             string
	RequestId      string
	Source         ChannelMember
	Sink           ChannelMember
	ForwardingRule ForwardingRule
}

type DisconnectSocketChannelPacket

type DisconnectSocketChannelPacket struct {
	// channel id to disconnect
	Id string
}

type ForwardingRule

type ForwardingRule struct {
	LocalPort    int
	RemoteClient string
	RemoteHost   string
	RemotePort   int
	// if based on the current state of the channel this rule is Valid
	Valid bool
}

func NewForwardingRuleFromArg

func NewForwardingRuleFromArg(arg string) *ForwardingRule

NewForwardingRuleFromArg creates a new forwarding rule

Jump to

Keyboard shortcuts

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