Browse Source
Use this script for TURN testing. Make sure Spreed WebRTC has a TURN server configured which also supports tcp. Make a call and check chrome://webrtc-internals or about:webrtc to see if TURN is actually in use (also make sure that audio and video is coming through in both directions). https://github.com/strukturag/docker-webrtc-turnserver/issues/5pull/374/head
1 changed files with 51 additions and 0 deletions
@ -0,0 +1,51 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# |
||||||
|
# This script blocks all outbound and inbound DNS except DNS. If all UDP is |
||||||
|
# blocked, the only way to do a peer to peer connection is with a TURN server |
||||||
|
# which supports tcp. |
||||||
|
# |
||||||
|
# NOTE: this script requires Linux and must be run as root/sudo. |
||||||
|
# |
||||||
|
# (c)2016 struktur AG |
||||||
|
# http://www.struktur.de |
||||||
|
|
||||||
|
set -e |
||||||
|
RETVAL=0 |
||||||
|
|
||||||
|
run() { |
||||||
|
set -x |
||||||
|
local mode=$1 |
||||||
|
iptables $mode INPUT -p udp --sport 53 -j ACCEPT |
||||||
|
iptables $mode INPUT -p udp --dport 53 -j ACCEPT |
||||||
|
iptables $mode OUTPUT -p udp --sport 53 -j ACCEPT |
||||||
|
iptables $mode OUTPUT -p udp --dport 53 -j ACCEPT |
||||||
|
|
||||||
|
iptables $mode INPUT -p udp -j DROP |
||||||
|
iptables $mode OUTPUT -p udp -j DROP |
||||||
|
set +x |
||||||
|
} |
||||||
|
|
||||||
|
start() { |
||||||
|
run -A |
||||||
|
} |
||||||
|
|
||||||
|
stop() { |
||||||
|
set +e |
||||||
|
run -D |
||||||
|
set -e |
||||||
|
} |
||||||
|
|
||||||
|
case "$1" in |
||||||
|
start) |
||||||
|
start |
||||||
|
;; |
||||||
|
stop) |
||||||
|
stop |
||||||
|
;; |
||||||
|
*) |
||||||
|
echo "Usage: $0 [start|stop]" |
||||||
|
RETVAL=1 |
||||||
|
;; |
||||||
|
esac |
||||||
|
|
||||||
|
exit $RETVAL |
||||||
Loading…
Reference in new issue