ice

package
v1.2.77 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

https://tools.ietf.org/html/rfc7064

https://tools.ietf.org/html/rfc7064 3.2. URI Scheme Semantics https://tools.ietf.org/html/rfc7065 3.2. URI Scheme Semantics

https://tools.ietf.org/html/rfc7065

https://tools.ietf.org/html/rfc7064 https://tools.ietf.org/html/rfc7065

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheme

type Scheme string

Scheme indicates the type of server used in the ice.URL structure.

const (
	// SchemeSTUN indicates the URL represents a STUN server.
	SchemeSTUN Scheme = "stun"

	// SchemeSTUNS indicates the URL represents a STUNS (secure) server.
	SchemeSTUNS Scheme = "stuns"

	// SchemeTURN indicates the URL represents a TURN server.
	SchemeTURN Scheme = "turn"

	// SchemeTURNS indicates the URL represents a TURNS (secure) server.
	SchemeTURNS Scheme = "turns"
)

func ParseSchemeType

func ParseSchemeType(s string) (Scheme, error)

func (Scheme) String

func (t Scheme) String() string

type Transport

type Transport string

Transport indicates the transport protocol type that is used in the ice.URL structure.

const (
	// TransportUDP indicates the URL uses:
	// a UDP transport for turn|stun.
	// a DTLS-over-UDP transport for turns|stuns.
	TransportUDP Transport = "udp"

	// TransportTCP indicates the URL uses:
	// a TCP transport for turn|stun.
	// a TLS-over-TCP transport for turns|stuns.
	TransportTCP = "tcp"
)

func ParseProto

func ParseProto(s string) (Transport, error)

func (Transport) String

func (t Transport) String() string

https://tools.ietf.org/html/rfc7065 transport-ext = 1*unreserved

type URL

type URL struct {
	Scheme Scheme
	Host   string
	Port   int
	Proto  Transport
}

URL represents a STUN (rfc7064) or TURN (rfc7065) URL

func ParseURL

func ParseURL(raw string) (*URL, error)

ParseURL parses a STUN or TURN urls following the ABNF syntax described in https://tools.ietf.org/html/rfc7064 and https://tools.ietf.org/html/rfc7065 respectively.

func (URL) IsSecure

func (u URL) IsSecure() bool

IsSecure returns whether the this URL's scheme describes secure scheme or not.

func (URL) IsStunFamily

func (u URL) IsStunFamily() bool

func (URL) IsTurnFamily

func (u URL) IsTurnFamily() bool

func (URL) String

func (u URL) String() string

Jump to

Keyboard shortcuts

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