Documentation ¶
Index ¶
- Constants
- Variables
- type ALPNListener
- type ALPNListenerConfig
- type Agent
- type AgentAuthenticationInfo
- type AgentConfig
- type AgentInfo
- type AgentRole
- type AgentState
- type AgentTransport
- type ApplicationConnection
- type ApplicationStream
- type AuthenticationRole
- type Connection
- func (c *Connection) AcceptDataChannel(ctx context.Context) (*DataChannel, error)
- func (c *Connection) AcceptTransport(ctx context.Context) (*PooledWebTransport, error)
- func (c *Connection) Close() error
- func (c *Connection) LocalAgent() *Agent
- func (c *Connection) NewTransport(ctx context.Context) (*PooledWebTransport, error)
- func (c *Connection) NewTransportListener() (*PooledWebTransport, error)
- func (c *Connection) OpenDataChannel(ctx context.Context, params DataChannelParameters) (*DataChannel, error)
- func (c *Connection) RemoteAgent() *Agent
- type DTLSNetworkConnection
- func (c *DTLSNetworkConnection) Close() error
- func (c *DTLSNetworkConnection) ConnectionState() tls.ConnectionState
- func (c *DTLSNetworkConnection) IntoApplicationConnection() (ApplicationConnection, error)
- func (c *DTLSNetworkConnection) IsReliable() bool
- func (c *DTLSNetworkConnection) Read(p []byte) (int, error)
- func (c *DTLSNetworkConnection) Write(p []byte) (int, error)
- type DTLSNetworkListener
- type DTLSTransport
- type DataChannel
- func (c *DataChannel) Close() error
- func (c *DataChannel) Read(p []byte) (int, error)
- func (c *DataChannel) ReadDataChannel(p []byte) (int, DataEncoding, error)
- func (c *DataChannel) ReceiveMessage() ([]byte, error)
- func (c *DataChannel) ReceiveMessageWithEncoding() ([]byte, DataEncoding, error)
- func (c *DataChannel) SendMessage(payload []byte) error
- func (c *DataChannel) SendMessageWithEncoding(payload []byte, enc DataEncoding) error
- func (c *DataChannel) Write(p []byte) (n int, err error)
- func (c *DataChannel) WriteDataChannel(p []byte, enc DataEncoding) (n int, err error)
- type DataChannelParameters
- type DataEncoding
- type DiscoveredAgent
- type Discoverer
- type Listener
- type NetworkConnection
- type NetworkListener
- type NetworkTransport
- type PSKConfig
- type PeerID
- type PooledWebTransport
- type QuicApplicationConnection
- type QuicApplicationStream
- type QuicNetworkConnection
- func (q *QuicNetworkConnection) Close() error
- func (q *QuicNetworkConnection) ConnectionState() tls.ConnectionState
- func (q *QuicNetworkConnection) IntoApplicationConnection() (ApplicationConnection, error)
- func (q *QuicNetworkConnection) IsReliable() bool
- func (q *QuicNetworkConnection) Read(p []byte) (int, error)
- func (q *QuicNetworkConnection) Write(p []byte) (int, error)
- type QuicNetworkListener
- type QuicStream
- type QuicTransport
- type SCTPApplicationConnection
- type SCTPApplicationStream
- type TXTRecordSet
- type TransportListener
- type TypeKey
- type UnauthenticatedConnection
- func (c *UnauthenticatedConnection) AcceptAuthenticate(ctx context.Context) (role AuthenticationRole, err error)
- func (c *UnauthenticatedConnection) AuthenticatePSK(ctx context.Context, psk []byte) (*Connection, error)
- func (c *UnauthenticatedConnection) Close() error
- func (c *UnauthenticatedConnection) GeneratePSK() ([]byte, error)
- func (c *UnauthenticatedConnection) GetAuthenticationRole() AuthenticationRole
- func (c *UnauthenticatedConnection) LocalAgent() *Agent
- func (c *UnauthenticatedConnection) RemoteAgent() *Agent
- func (c *UnauthenticatedConnection) RequestAuthenticatePSK() error
Constants ¶
const ( AgentCapabilityDataChannels msgAgentCapability = 1100 AgentCapabilityQuickTransport msgAgentCapability = 1200 )
const ( DataChannelEncodingIdEncodingIdBlob msgDataChannelEncodingId = 0 DataChannelEncodingIdEncodingIdString msgDataChannelEncodingId = 1 DataChannelEncodingIdEncodingIdArrayBuffer msgDataChannelEncodingId = 2 )
const ( AgentCapabilityReceiveAudio msgAgentCapability = 1 AgentCapabilityReceiveVideo msgAgentCapability = 2 AgentCapabilityReceivePresentation msgAgentCapability = 3 AgentCapabilityControlPresentation msgAgentCapability = 4 AgentCapabilityReceiveRemotePlayback msgAgentCapability = 5 AgentCapabilityControlRemotePlayback msgAgentCapability = 6 AgentCapabilityReceiveStreaming msgAgentCapability = 7 AgentCapabilitySendStreaming msgAgentCapability = 8 )
const ( PskInputMethodNumeric msgPskInputMethod = 0 PskInputMethodQrCode msgPskInputMethod = 1 )
const ( AuthSpake2PskStatusPskNeedsPresentation msgAuthSpake2PskStatus = 0 AuthSpake2PskStatusPskShown msgAuthSpake2PskStatus = 1 AuthSpake2PskStatusPskInput msgAuthSpake2PskStatus = 2 )
const ( AuthStatusResultAuthenticated msgAuthStatusResult = 0 AuthStatusResultUnknownError msgAuthStatusResult = 1 AuthStatusResultTimeout msgAuthStatusResult = 2 AuthStatusResultSecretUnknown msgAuthStatusResult = 3 AuthStatusResultValidationTookTooLong msgAuthStatusResult = 4 AuthStatusResultProofInvalid msgAuthStatusResult = 5 )
const ( UrlAvailabilityAvailable msgUrlAvailability = 0 UrlAvailabilityInvalid msgUrlAvailability = 10 )
const ( PresentationTerminationSourceController msgPresentationTerminationSource = 1 PresentationTerminationSourceReceiver msgPresentationTerminationSource = 2 PresentationTerminationSourceUnknown msgPresentationTerminationSource = 255 )
const ( PresentationTerminationReasonApplicationRequest msgPresentationTerminationReason = 1 PresentationTerminationReasonUserRequest msgPresentationTerminationReason = 2 PresentationTerminationReasonReceiverReplacedPresentation msgPresentationTerminationReason = 20 PresentationTerminationReasonReceiverIdleTooLong msgPresentationTerminationReason = 30 PresentationTerminationReasonReceiverPoweringDown msgPresentationTerminationReason = 100 PresentationTerminationReasonReceiverError msgPresentationTerminationReason = 101 PresentationTerminationReasonUnknown msgPresentationTerminationReason = 255 )
const ( PresentationConnectionCloseEventReasonCloseMethodCalled msgPresentationConnectionCloseEventReason = 1 PresentationConnectionCloseEventReasonConnectionObjectDiscarded msgPresentationConnectionCloseEventReason = 10 PresentationConnectionCloseEventReasonUnrecoverableErrorWhileSendingOrReceivingMessage msgPresentationConnectionCloseEventReason = 100 )
const ( ResultSuccess msgResult = 1 ResultInvalidUrl msgResult = 10 ResultInvalidPresentationId msgResult = 11 ResultTimeout msgResult = 100 ResultTransientError msgResult = 101 ResultPermanentError msgResult = 102 ResultTerminating msgResult = 103 ResultUnknownError msgResult = 199 )
const ( RemotePlaybackTerminationRequestReasonUserTerminatedViaController msgRemotePlaybackTerminationRequestReason = 11 RemotePlaybackTerminationRequestReasonUnknown msgRemotePlaybackTerminationRequestReason = 255 )
const ( RemotePlaybackTerminationEventReasonReceiverCalledTerminate msgRemotePlaybackTerminationEventReason = 1 RemotePlaybackTerminationEventReasonUserTerminatedViaReceiver msgRemotePlaybackTerminationEventReason = 2 RemotePlaybackTerminationEventReasonReceiverIdleTooLong msgRemotePlaybackTerminationEventReason = 30 RemotePlaybackTerminationEventReasonReceiverPoweringDown msgRemotePlaybackTerminationEventReason = 100 RemotePlaybackTerminationEventReasonReceiverCrashed msgRemotePlaybackTerminationEventReason = 101 RemotePlaybackTerminationEventReasonUnknown msgRemotePlaybackTerminationEventReason = 255 )
const ( RemotePlaybackControlsPreloadNone msgRemotePlaybackControlsPreload = 0 RemotePlaybackControlsPreloadMetadata msgRemotePlaybackControlsPreload = 1 RemotePlaybackControlsPreloadAuto msgRemotePlaybackControlsPreload = 2 )
const ( RemotePlaybackStateLoadingEmpty msgRemotePlaybackStateLoading = 0 RemotePlaybackStateLoadingIdle msgRemotePlaybackStateLoading = 1 RemotePlaybackStateLoadingLoading msgRemotePlaybackStateLoading = 2 RemotePlaybackStateLoadingNoSource msgRemotePlaybackStateLoading = 3 )
const ( RemotePlaybackStateLoadedNothing msgRemotePlaybackStateLoaded = 0 RemotePlaybackStateLoadedMetadata msgRemotePlaybackStateLoaded = 1 RemotePlaybackStateLoadedCurrent msgRemotePlaybackStateLoaded = 2 RemotePlaybackStateLoadedFuture msgRemotePlaybackStateLoaded = 3 RemotePlaybackStateLoadedEnough msgRemotePlaybackStateLoaded = 4 )
const ( AddedTextTrackKindSubtitles msgAddedTextTrackKind = 1 AddedTextTrackKindCaptions msgAddedTextTrackKind = 2 AddedTextTrackKindDescriptions msgAddedTextTrackKind = 3 AddedTextTrackKindChapters msgAddedTextTrackKind = 4 AddedTextTrackKindMetadata msgAddedTextTrackKind = 5 )
const ( TextTrackModeDisabled msgTextTrackMode = 1 TextTrackModeShowing msgTextTrackMode = 2 TextTrackModeHidden msgTextTrackMode = 3 )
const ( MediaErrorMsgCodeUserAborted msgMediaErrorMsgCode = 1 MediaErrorMsgCodeNetworkError msgMediaErrorMsgCode = 2 MediaErrorMsgCodeDecodeError msgMediaErrorMsgCode = 3 MediaErrorMsgCodeSourceNotSupported msgMediaErrorMsgCode = 4 MediaErrorMsgCodeUnknownError msgMediaErrorMsgCode = 5 )
const ( VideoRotationVideoRotation0 msgVideoRotation = 0 VideoRotationVideoRotation90 msgVideoRotation = 1 VideoRotationVideoRotation180 msgVideoRotation = 2 VideoRotationVideoRotation270 msgVideoRotation = 3 )
const ( StreamingBufferStatusEnoughData msgStreamingBufferStatus = 0 StreamingBufferStatusInsufficientData msgStreamingBufferStatus = 1 StreamingBufferStatusTooMuchData msgStreamingBufferStatus = 2 )
const ( DataEncodingBinary = iota DataEncodingString DataEncodingArrayBuffer )
const ( MdnsServiceType = "_openscreen._udp" MdnsDomain = "local" ALPN_OSP = "osp" )
const MTU = 8192
Variables ¶
var ErrConnectionClosed = errors.New("connection closed")
var ErrDiscovererClosed = errors.New("discoverer closed")
var ErrHandedOff = errors.New("connection handed off")
var ErrListenerClosed = errors.New("listener closed")
var ErrTransportClosed = errors.New("transport closed")
var ErrTransportHandedOff = errors.New("transport handed off")
Functions ¶
This section is empty.
Types ¶
type ALPNListener ¶
type ALPNListener struct {
// contains filtered or unexported fields
}
ALPNListener allows listening for application protocols on the same port as OSP.
func (*ALPNListener) Accept ¶
func (l *ALPNListener) Accept(ctx context.Context) (quic.Connection, error)
func (*ALPNListener) Close ¶
func (l *ALPNListener) Close() error
type ALPNListenerConfig ¶
type ALPNListenerConfig struct {
VerifyConnection func(cs tls.ConnectionState) error
}
type Agent ¶
type Agent struct { PeerID PeerID Certificate *tls.Certificate CertificateSNBase uint32 CertificateSNCounter uint32 // contains filtered or unexported fields }
func NewAgent ¶
func NewAgent(c AgentConfig) (*Agent, error)
func (*Agent) AuthenticationInfo ¶
func (a *Agent) AuthenticationInfo() *AgentAuthenticationInfo
func (*Agent) CertificateFingerPrint ¶
func (*Agent) HasAuthenticationInfo ¶
func (*Agent) NewRemoteAgent ¶
func (a *Agent) NewRemoteAgent(nc NetworkConnection) (*Agent, error)
type AgentAuthenticationInfo ¶
type AgentAuthenticationInfo struct {
PSKConfig PSKConfig
}
type AgentConfig ¶
type AgentConfig struct { // ID PeerID PeerID Certificate *tls.Certificate CertificateSNBase uint32 // Info DisplayName string ModelName string Locales []string // AuthInfo PSKConfig PSKConfig SupportedTransports []AgentTransport }
func NewAgentConfig ¶
func NewAgentConfig(nickname string) AgentConfig
func (*AgentConfig) WithCertificateSNBase ¶
func (c *AgentConfig) WithCertificateSNBase(snBase uint32)
func (*AgentConfig) WithModelName ¶
func (c *AgentConfig) WithModelName(easeOfInput, entropy int)
func (*AgentConfig) WithPSKConfig ¶
func (c *AgentConfig) WithPSKConfig(easeOfInput, entropy int)
type AgentState ¶
type AgentTransport ¶
type AgentTransport int
const ( AgentTransportQUIC AgentTransport = iota + 1 AgentTransportWebRTC )
type ApplicationConnection ¶
type ApplicationConnection interface { AcceptStream(context.Context) (ApplicationStream, error) OpenStreamSync(context.Context) (ApplicationStream, error) Close() error }
Abstract connection for the application protocol.
type ApplicationStream ¶
type ApplicationStream interface { io.ReadWriteCloser }
Abstract stream for the application protocol.
type AuthenticationRole ¶
type AuthenticationRole int
const ( AuthenticationRolePresenter AuthenticationRole = 0 AuthenticationRoleConsumer AuthenticationRole = 1 )
func (AuthenticationRole) String ¶
func (t AuthenticationRole) String() string
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection
func (*Connection) AcceptDataChannel ¶
func (c *Connection) AcceptDataChannel(ctx context.Context) (*DataChannel, error)
AcceptStream accepts a data channel
func (*Connection) AcceptTransport ¶
func (c *Connection) AcceptTransport(ctx context.Context) (*PooledWebTransport, error)
func (*Connection) Close ¶
func (c *Connection) Close() error
Close the connection and all associated steams.
func (*Connection) LocalAgent ¶
func (c *Connection) LocalAgent() *Agent
func (*Connection) NewTransport ¶
func (c *Connection) NewTransport(ctx context.Context) (*PooledWebTransport, error)
NewTransport
func (*Connection) NewTransportListener ¶
func (c *Connection) NewTransportListener() (*PooledWebTransport, error)
func (*Connection) OpenDataChannel ¶
func (c *Connection) OpenDataChannel(ctx context.Context, params DataChannelParameters) (*DataChannel, error)
OpenDataChannel opens a data channel
func (*Connection) RemoteAgent ¶
func (c *Connection) RemoteAgent() *Agent
type DTLSNetworkConnection ¶
type DTLSNetworkConnection struct {
// contains filtered or unexported fields
}
func NewDTLSNetworkConnection ¶
func NewDTLSNetworkConnection(conn *dtls.Conn) *DTLSNetworkConnection
func (*DTLSNetworkConnection) Close ¶
func (c *DTLSNetworkConnection) Close() error
func (*DTLSNetworkConnection) ConnectionState ¶
func (c *DTLSNetworkConnection) ConnectionState() tls.ConnectionState
func (*DTLSNetworkConnection) IntoApplicationConnection ¶
func (c *DTLSNetworkConnection) IntoApplicationConnection() (ApplicationConnection, error)
func (*DTLSNetworkConnection) IsReliable ¶
func (c *DTLSNetworkConnection) IsReliable() bool
type DTLSNetworkListener ¶
type DTLSNetworkListener struct {
// contains filtered or unexported fields
}
func (*DTLSNetworkListener) Accept ¶
func (l *DTLSNetworkListener) Accept(ctx context.Context) (NetworkConnection, error)
func (*DTLSNetworkListener) Addr ¶
func (l *DTLSNetworkListener) Addr() net.Addr
type DTLSTransport ¶
type DTLSTransport struct{}
func NewDTLSTransport ¶
func NewDTLSTransport() *DTLSTransport
func (*DTLSTransport) DialAddr ¶
func (t *DTLSTransport) DialAddr(ctx context.Context, addr string, tlsConf *tls.Config) (NetworkConnection, error)
func (*DTLSTransport) ListenAddr ¶
func (t *DTLSTransport) ListenAddr(addr string, tlsConf *tls.Config) (NetworkListener, error)
type DataChannel ¶
type DataChannel struct { DataChannelParameters // contains filtered or unexported fields }
func (*DataChannel) Close ¶
func (c *DataChannel) Close() error
Close closes the DataChannel and the underlying Quic stream.
func (*DataChannel) Read ¶
func (c *DataChannel) Read(p []byte) (int, error)
Read reads a packet of len(p) bytes as binary data
func (*DataChannel) ReadDataChannel ¶
func (c *DataChannel) ReadDataChannel(p []byte) (int, DataEncoding, error)
ReadDataChannel reads a packet of len(p) bytes
func (*DataChannel) ReceiveMessage ¶
func (c *DataChannel) ReceiveMessage() ([]byte, error)
ReceiveMessage
func (*DataChannel) ReceiveMessageWithEncoding ¶
func (c *DataChannel) ReceiveMessageWithEncoding() ([]byte, DataEncoding, error)
ReceiveMessageWithEncoding
func (*DataChannel) SendMessage ¶
func (c *DataChannel) SendMessage(payload []byte) error
SendMessage
func (*DataChannel) SendMessageWithEncoding ¶
func (c *DataChannel) SendMessageWithEncoding(payload []byte, enc DataEncoding) error
SendMessageWithEncoding
func (*DataChannel) Write ¶
func (c *DataChannel) Write(p []byte) (n int, err error)
Write writes len(p) bytes from p as binary data
func (*DataChannel) WriteDataChannel ¶
func (c *DataChannel) WriteDataChannel(p []byte, enc DataEncoding) (n int, err error)
WriteDataChannel writes len(p) bytes from p
type DataChannelParameters ¶
DataChannelParameters
type DataEncoding ¶
type DataEncoding uint64
DataEncoding represents pre-agreed EncodingIds used in exchange-data.
type DiscoveredAgent ¶
type DiscoveredAgent struct { PeerID PeerID TXT TXTRecordSet // contains filtered or unexported fields }
DiscoveredAgent represents a discovered remote agent that has not been contacted yet.
func (DiscoveredAgent) Dial ¶
func (ra DiscoveredAgent) Dial(ctx context.Context, transportType AgentTransport, la *Agent) (*UnauthenticatedConnection, error)
Dial opens a connection to the remote agent.
func (*DiscoveredAgent) Nickname ¶
func (a *DiscoveredAgent) Nickname() string
Nickname of the remote agent
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
Discoverer is used to discover agents.
func (*Discoverer) Accept ¶
func (d *Discoverer) Accept(ctx context.Context) (*DiscoveredAgent, error)
Accept returns an a discovered agent. It should be called in a loop.
func (*Discoverer) Close ¶
func (d *Discoverer) Close() error
Close closes the discoverer. Any blocked Accept operations will be unblocked and return errors.
func (*Discoverer) WithNickname ¶
func (d *Discoverer) WithNickname(nickname string)
WithNickname defines a nickname of agents to discover.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener acts as an advertising OSP agent and listens for incoming connections.
func Listen ¶
func Listen(transportType AgentTransport, a *Agent) (*Listener, error)
Listen starts an advertising agent and listens for incoming connections.
func NewListener ¶
func NewListener(a *Agent, transportType AgentTransport) *Listener
NewListener creates a new Listener
func (*Listener) Accept ¶
func (l *Listener) Accept(ctx context.Context) (*UnauthenticatedConnection, error)
Accept returns an a discovered agent. It should be called in a loop.
func (*Listener) Close ¶
Close closes the listener. Any blocked Accept operations will be unblocked and return errors.
func (*Listener) ListenApplication ¶
func (l *Listener) ListenApplication(alpn string, config *ALPNListenerConfig) *ALPNListener
ListenApplication allows you to listen for quic connections on the same port but with a different ALPN. Only one per ALPN is allowed. Needs to be registered before starting the Listener.
type NetworkConnection ¶
type NetworkConnection interface { io.ReadWriteCloser // Determines if this connection supports reliable delivery. If not, the // network protocol agent needs to perform timeout & retransmission. IsReliable() bool // Upgrades the connection to an application connection. Any proceeding // calls to the network connection will fail. IntoApplicationConnection() (ApplicationConnection, error) ConnectionState() tls.ConnectionState }
Abstract connection for the network protocol, responsible for getting extended agent capabilities and performing the authentication ceremony.
type NetworkListener ¶
type NetworkTransport ¶
type NetworkTransport interface { DialAddr(ctx context.Context, addr string, tlsConf *tls.Config) (NetworkConnection, error) ListenAddr(addr string, tlsConf *tls.Config) (NetworkListener, error) }
func NewNetworkTransport ¶
func NewNetworkTransport(typ AgentTransport) (NetworkTransport, error)
type PeerID ¶
type PeerID string
PeerID is a unique identifier for a peer, it is equal tot the OSP agent fingerprint (FP) of the peer.
type PooledWebTransport ¶
type PooledWebTransport struct {
// contains filtered or unexported fields
}
PooledWebTransport implements WebTransport pooled over an existing OpenScreenProtocol Application Transport.
func (*PooledWebTransport) AcceptStream ¶
func (t *PooledWebTransport) AcceptStream(ctx context.Context) (*QuicStream, error)
func (*PooledWebTransport) CloseWithError ¶
func (t *PooledWebTransport) CloseWithError(uint64, string) error
func (*PooledWebTransport) OpenStreamSync ¶
func (t *PooledWebTransport) OpenStreamSync(ctx context.Context) (*QuicStream, error)
type QuicApplicationConnection ¶
type QuicApplicationConnection struct {
// contains filtered or unexported fields
}
func (*QuicApplicationConnection) AcceptStream ¶
func (q *QuicApplicationConnection) AcceptStream(ctx context.Context) (ApplicationStream, error)
func (*QuicApplicationConnection) Close ¶
func (q *QuicApplicationConnection) Close() error
func (*QuicApplicationConnection) OpenStreamSync ¶
func (q *QuicApplicationConnection) OpenStreamSync(ctx context.Context) (ApplicationStream, error)
type QuicApplicationStream ¶
type QuicApplicationStream struct {
// contains filtered or unexported fields
}
func (*QuicApplicationStream) Close ¶
func (s *QuicApplicationStream) Close() error
type QuicNetworkConnection ¶
type QuicNetworkConnection struct {
// contains filtered or unexported fields
}
func NewQuicNetworkConnection ¶
func NewQuicNetworkConnection(conn quic.Connection) *QuicNetworkConnection
func (*QuicNetworkConnection) Close ¶
func (q *QuicNetworkConnection) Close() error
func (*QuicNetworkConnection) ConnectionState ¶
func (q *QuicNetworkConnection) ConnectionState() tls.ConnectionState
func (*QuicNetworkConnection) IntoApplicationConnection ¶
func (q *QuicNetworkConnection) IntoApplicationConnection() (ApplicationConnection, error)
func (*QuicNetworkConnection) IsReliable ¶
func (q *QuicNetworkConnection) IsReliable() bool
type QuicNetworkListener ¶
type QuicNetworkListener struct {
// contains filtered or unexported fields
}
func (*QuicNetworkListener) Accept ¶
func (l *QuicNetworkListener) Accept(ctx context.Context) (NetworkConnection, error)
func (*QuicNetworkListener) Addr ¶
func (l *QuicNetworkListener) Addr() net.Addr
type QuicStream ¶
type QuicStream struct {
// contains filtered or unexported fields
}
Stream
func (*QuicStream) Close ¶
func (s *QuicStream) Close() error
func (*QuicStream) StreamID ¶
func (s *QuicStream) StreamID() int64
type QuicTransport ¶
type QuicTransport struct{}
func NewQuicTransport ¶
func NewQuicTransport() *QuicTransport
func (*QuicTransport) DialAddr ¶
func (t *QuicTransport) DialAddr(ctx context.Context, addr string, tlsConf *tls.Config) (NetworkConnection, error)
func (*QuicTransport) ListenAddr ¶
func (t *QuicTransport) ListenAddr(addr string, tlsConf *tls.Config) (NetworkListener, error)
type SCTPApplicationConnection ¶
type SCTPApplicationConnection struct {
// contains filtered or unexported fields
}
func (*SCTPApplicationConnection) AcceptStream ¶
func (c *SCTPApplicationConnection) AcceptStream(ctx context.Context) (ApplicationStream, error)
func (*SCTPApplicationConnection) Close ¶
func (c *SCTPApplicationConnection) Close() error
func (*SCTPApplicationConnection) OpenStreamSync ¶
func (c *SCTPApplicationConnection) OpenStreamSync(ctx context.Context) (ApplicationStream, error)
type SCTPApplicationStream ¶
type SCTPApplicationStream struct {
// contains filtered or unexported fields
}
func NewSCTPApplicationStream ¶
func NewSCTPApplicationStream(stream *sctp.Stream) *SCTPApplicationStream
func (*SCTPApplicationStream) Close ¶
func (s *SCTPApplicationStream) Close() error
type TXTRecordSet ¶
func (TXTRecordSet) Add ¶
func (r TXTRecordSet) Add(key, value string)
func (TXTRecordSet) FromSlice ¶
func (r TXTRecordSet) FromSlice(in []string) error
func (TXTRecordSet) Get ¶
func (r TXTRecordSet) Get(key string) []string
func (TXTRecordSet) Set ¶
func (r TXTRecordSet) Set(key, value string)
func (TXTRecordSet) ToSlice ¶
func (r TXTRecordSet) ToSlice() []string
type TransportListener ¶
type TransportListener struct {
// contains filtered or unexported fields
}
func (*TransportListener) Accept ¶
func (l *TransportListener) Accept(ctx context.Context) (*PooledWebTransport, error)
func (*TransportListener) Close ¶
func (l *TransportListener) Close() error
type UnauthenticatedConnection ¶
type UnauthenticatedConnection struct {
// contains filtered or unexported fields
}
UnauthenticatedConnection represents an OSPC connection that didn't pass authentication yet.
func (*UnauthenticatedConnection) AcceptAuthenticate ¶
func (c *UnauthenticatedConnection) AcceptAuthenticate(ctx context.Context) (role AuthenticationRole, err error)
AcceptAuthenticate is used to handle an incoming authentication request. It has to be called for every UnauthenticatedConnection.
func (*UnauthenticatedConnection) AuthenticatePSK ¶
func (c *UnauthenticatedConnection) AuthenticatePSK(ctx context.Context, psk []byte) (*Connection, error)
Authenticate is used to authenticate. It will block until authentication is complete or the context is closed.
func (*UnauthenticatedConnection) Close ¶
func (c *UnauthenticatedConnection) Close() error
Close the unauthenticated connection. If the connection has progressed to authenticated, it is not closed but an error is returned. This allows for defer closing regardless.
func (*UnauthenticatedConnection) GeneratePSK ¶
func (c *UnauthenticatedConnection) GeneratePSK() ([]byte, error)
GeneratePSK creates a PSK based on the negotiated config.
func (*UnauthenticatedConnection) GetAuthenticationRole ¶
func (c *UnauthenticatedConnection) GetAuthenticationRole() AuthenticationRole
GetAuthenticationRole determines if the agent should act as presenter or consumer of the PSK.
func (*UnauthenticatedConnection) LocalAgent ¶
func (c *UnauthenticatedConnection) LocalAgent() *Agent
LocalAgent provides info about local agent
func (*UnauthenticatedConnection) RemoteAgent ¶
func (c *UnauthenticatedConnection) RemoteAgent() *Agent
RemoteAgent provides info about remote agent
func (*UnauthenticatedConnection) RequestAuthenticatePSK ¶
func (c *UnauthenticatedConnection) RequestAuthenticatePSK() error
RequestAuthenticatePSK is used to request authentication as an initiating collector agent.
Source Files ¶
- agent.go
- apln_listener.go
- connection.go
- connection_application.go
- connection_network.go
- datachannel.go
- dialer.go
- discover.go
- listener.go
- message.go
- message_io.go
- messages_lp2p.go
- messages_osp.go
- messages_wip.go
- ospc.go
- quictransport.go
- stream.go
- transport.go
- transport_quic.go
- transport_webrtc.go
- varuint.go