util

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeSessionDescription

func DeserializeSessionDescription(msg string) (*webrtc.SessionDescription, error)

func GetCandidateAddrs added in v2.9.2

func GetCandidateAddrs(sdpStr string) []net.IP

Returns a list of IP addresses of ICE candidates, roughly in descending order for accuracy for geolocation

func GetClientIp added in v2.9.2

func GetClientIp(req *http.Request) string

Attempts to retrieve the client IP of where the HTTP request originating. There is no standard way to do this since the original client IP can be included in a number of different headers, depending on the proxies and load balancers between the client and the server. We attempt to check as many of these headers as possible to determine a "best guess" of the client IP Using this as a reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded

func IsLocal

func IsLocal(ip net.IP) bool

Stolen from https://github.com/golang/go/pull/30278

func SerializeSessionDescription

func SerializeSessionDescription(desc *webrtc.SessionDescription) (string, error)

func StripLocalAddresses

func StripLocalAddresses(str string) string

Removes local LAN address ICE candidates

Types

This section is empty.

Jump to

Keyboard shortcuts

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