StreamPeerTLS

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

A stream peer that handles TLS connections. This object can be used to connect to a TLS server or accept a single TLS client connection.

Note: When exporting to Android, make sure to enable the INTERNET permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsStreamPeerTLS() Instance
}

type Expanded

type Expanded = MoreArgs

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsStreamPeer

func (self *Extension[T]) AsStreamPeer() StreamPeer.Instance

func (*Extension[T]) AsStreamPeerTLS

func (self *Extension[T]) AsStreamPeerTLS() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.StreamPeerTLS

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AcceptStream

func (self Instance) AcceptStream(stream StreamPeer.Instance, server_options TLSOptions.Instance) error

Accepts a peer connection as a server using the given 'server_options'. See TLSOptions.Server.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsStreamPeer

func (self Instance) AsStreamPeer() StreamPeer.Instance

func (Instance) AsStreamPeerTLS

func (self Instance) AsStreamPeerTLS() Instance

func (Instance) ConnectToStream

func (self Instance) ConnectToStream(stream StreamPeer.Instance, common_name string) error

Connects to a peer using an underlying StreamPeer 'stream' and verifying the remote certificate is correctly signed for the given 'common_name'. You can pass the optional 'client_options' parameter to customize the trusted certification authorities, or disable the common name verification. See TLSOptions.Client and TLSOptions.ClientUnsafe.

func (Instance) DisconnectFromStream

func (self Instance) DisconnectFromStream()

Disconnects from host.

func (Instance) GetStatus

func (self Instance) GetStatus() Status

Returns the status of the connection.

func (Instance) GetStream

func (self Instance) GetStream() StreamPeer.Instance

Returns the underlying StreamPeer connection, used in AcceptStream or ConnectToStream.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) MoreArgs

func (self Instance) MoreArgs() MoreArgs

MoreArgs enables certain functions to be called with additional 'optional' arguments.

func (Instance) Poll

func (self Instance) Poll()

Poll the connection to check for incoming bytes. Call this right before StreamPeer.GetAvailableBytes for it to work properly.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type MoreArgs

type MoreArgs [1]gdclass.StreamPeerTLS

MoreArgs is a container for Instance functions with additional 'optional' arguments.

func (MoreArgs) ConnectToStream

func (self MoreArgs) ConnectToStream(stream StreamPeer.Instance, common_name string, client_options TLSOptions.Instance) error

Connects to a peer using an underlying StreamPeer 'stream' and verifying the remote certificate is correctly signed for the given 'common_name'. You can pass the optional 'client_options' parameter to customize the trusted certification authorities, or disable the common name verification. See TLSOptions.Client and TLSOptions.ClientUnsafe.

type Status

type Status int //gd:StreamPeerTLS.Status
const (
	// A status representing a [StreamPeerTLS] that is disconnected.
	//
	// [StreamPeerTLS]: https://pkg.go.dev/graphics.gd/classdb/StreamPeerTLS
	StatusDisconnected Status = 0
	// A status representing a [StreamPeerTLS] during handshaking.
	//
	// [StreamPeerTLS]: https://pkg.go.dev/graphics.gd/classdb/StreamPeerTLS
	StatusHandshaking Status = 1
	// A status representing a [StreamPeerTLS] that is connected to a host.
	//
	// [StreamPeerTLS]: https://pkg.go.dev/graphics.gd/classdb/StreamPeerTLS
	StatusConnected Status = 2
	// A status representing a [StreamPeerTLS] in error state.
	//
	// [StreamPeerTLS]: https://pkg.go.dev/graphics.gd/classdb/StreamPeerTLS
	StatusError Status = 3
	// An error status that shows a mismatch in the TLS certificate domain presented by the host and the domain requested for validation.
	StatusErrorHostnameMismatch Status = 4
)

Jump to

Keyboard shortcuts

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