mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-27 11:28:51 +02:00
Make STUN server configurable
This commit is contained in:
@ -3,12 +3,7 @@ let peerConnection;
|
||||
startPeerConnection = () => {
|
||||
// Init peer connection
|
||||
peerConnection = new RTCPeerConnection({
|
||||
iceServers: [
|
||||
{
|
||||
// FIXME: let admin customize the stun server
|
||||
urls: 'stun:stun.l.google.com:19302'
|
||||
}
|
||||
]
|
||||
iceServers: [{ urls: stunServers }]
|
||||
})
|
||||
|
||||
// On connection change, change indicator color
|
||||
@ -80,6 +75,3 @@ startPeerConnection = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start
|
||||
startPeerConnection()
|
||||
|
@ -36,4 +36,12 @@
|
||||
|
||||
<script src="/static/js/sideWidget.js"></script>
|
||||
<script src="/static/js/viewer.js"></script>
|
||||
<script>
|
||||
const stunServers = [
|
||||
{{range $id, $value := .Cfg.STUNServers}}
|
||||
'{{$value}}',
|
||||
{{end}}
|
||||
]
|
||||
startPeerConnection()
|
||||
</script>
|
||||
{{end}}
|
@ -20,6 +20,9 @@ type Options struct {
|
||||
Hostname string
|
||||
Favicon string
|
||||
WidgetURL string
|
||||
|
||||
// Copied from WebRTC configuration
|
||||
STUNServers []string
|
||||
}
|
||||
|
||||
var (
|
||||
|
Reference in New Issue
Block a user