Source File
stun.go
Belonging Package
github.com/pion/stun
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MIT// Package stun implements Session Traversal Utilities for NAT (STUN) RFC 5389.//// The stun package is intended to use by package that implements extension// to STUN (e.g. TURN) or client/server applications.//// Most methods are designed to be zero allocations. If it is not enough,// low-level methods are available. On other hand, there are helpers that// reduce code repeat.//// See examples for Message for basic usage, or https://github.com/pion/turn// package for example of stun extension implementation.package stunimport ()// bin is shorthand to binary.BigEndian.var bin = binary.BigEndian //nolint:gochecknoglobalsfunc readFullOrPanic( io.Reader, []byte) int {, := io.ReadFull(, )if != nil {panic() //nolint}return}func writeOrPanic( io.Writer, []byte) int {, := .Write()if != nil {panic() //nolint}return}// IANA assigned ports for "stun" protocol.const (DefaultPort = 3478DefaultTLSPort = 5349)type transactionIDSetter struct{}func (transactionIDSetter) ( *Message) error {return .NewTransactionID()}// TransactionID is Setter for m.TransactionID.var TransactionID Setter = transactionIDSetter{} //nolint:gochecknoglobals
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |