Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help Wanted: Example for tls turn client ( pion webrtc ) #396

Closed
RohanDoshi21 opened this issue Apr 26, 2024 · 1 comment
Closed

Help Wanted: Example for tls turn client ( pion webrtc ) #396

RohanDoshi21 opened this issue Apr 26, 2024 · 1 comment

Comments

@RohanDoshi21
Copy link

The example mentioned in turn-server/tls let's me configure TLS enabled turn server.

I am using pion/webrtc, where I am providing it to the ICEServer, how can I enable TLS here ?

@rg0now
Copy link
Contributor

rg0now commented Apr 26, 2024

Here's a snippet of code to use a TURN server over TLS in pion/webrtc:

// Set the ICE server config
config := webrtc.Configuration{
	ICEServers: []webrtc.ICEServer{
		{
			URLs: []string{"turns:<TURN_SERVER_IP_ADDRESS>:<TURN_SERVER_PORT>?transport=tcp"},
			Username: "<USERNAME>",
			Credential: "<PASSWORD>",
		},
	},
}

// Create a new RTCPeerConnection
peerConnection, err := api.NewPeerConnection(config)

For the specification of the TURN URI format see the RFC here. Plus there are millions of examples on how to use pion/webrtc here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants