Add ice-proxy example

This commit is contained in:
Anton Manakin
2025-08-17 18:59:17 +03:00
committed by Joe Turki
parent 1557d318e2
commit afcb3487d9
8 changed files with 439 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
// SPDX-FileCopyrightText: 2025 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
//go:build !js
// +build !js
// ice-proxy demonstrates Pion WebRTC's proxy abilities.
package main
const (
turnServerAddr = "localhost:17342"
turnServerURL = "turn:" + turnServerAddr + "?transport=tcp"
turnUsername = "turn_username"
turnPassword = "turn_password"
)
func main() {
// Setup TURN server.
turnServer := newTURNServer()
defer turnServer.Close() // nolint:errcheck
// Setup answering agent with proxy and TURN.
setupAnsweringAgent()
// Setup offering agent with only direct communication.
setupOfferingAgent()
// Block forever
select {}
}