Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Experimentation to stream WebRTC media sources like capture devices, screen capt
-s[stun_address] : use an external STUN server (default:stun.l.google.com:19302 , -:means no STUN)
-T[username:password@]turn_address : start embeded TURN server (default:disabled)
-t[username:password@]turn_address : use an external TURN relay server (default:disabled)
-I icetransport : Set ice transport type (0=all,1=relay,2=nohost default:0)
-R [Udp port range min:max] : Set the webrtc udp port range (default 0:65535)
-W webrtc_trials_fields : Set the webrtc trials fields (default:WebRTC-FrameDropper/Disabled/)
-a[audio layer] : spefify audio capture layer to use (default:0)
Expand Down Expand Up @@ -174,6 +175,23 @@ upnpc -r 8000 tcp 3478 tcp 3478 udp

Adapting with the HTTP port, STUN port, TURN port.

### Forcing TURN relay mode

By default, WebRTC will try to establish a direct peer-to-peer connection and only use TURN relay as a fallback. If you want to force all connections to go through the TURN relay server (for security, network policy, or testing purposes), you can use the `-I 1` option:

```sh
# Force all connections through TURN relay
./webrtc-streamer -s- -T0.0.0.0:3478 -tturn:turn@$(curl -s ifconfig.me):3478 -I1

# With external TURN server
./webrtc-streamer -s- -tturn:[email protected]:3478 -I1
```

The `-I` option accepts the following values:
- `0` - Allow all connection types (default) - tries direct connection first, falls back to TURN
- `1` - Force relay only - all traffic goes through TURN server
- `2` - No host - prevents local network connections

## HTML Embedding

Instead of using the internal HTTP server, it is easy to display a WebRTC stream
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ int main(int argc, char *argv[])
std::cout << "\t -T[username:password@]turn_address : start embeded TURN server (default:disabled)" << std::endl;
std::cout << "\t -R Udp_port_min:Udp_port_min : Set the webrtc udp port range (default:" << localWebrtcUdpPortRange << ")" << std::endl;
std::cout << "\t -W webrtc_trials_fields : Set the webrtc trials fields (default:" << webrtcTrialsFields << ")" << std::endl;
std::cout << "\t -I icetransport : Set ice transport type (default:" << transportType << ")" << std::endl;
std::cout << "\t -I icetransport : Set ice transport type (0=all,1=relay,2=nohost default:" << transportType << ")" << std::endl;
#ifdef HAVE_SOUND
std::cout << "\t -a[audio layer] : spefify audio capture layer to use (default:" << audioLayer << ")" << std::endl;
#endif
Expand Down