Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
99026c0e
Commit
99026c0e
authored
Apr 29, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement option -udp-range.
parent
cd6920d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
galene.go
galene.go
+19
-0
group/group.go
group/group.go
+6
-0
No files found.
galene.go
View file @
99026c0e
...
...
@@ -2,6 +2,7 @@ package main
import
(
"flag"
"fmt"
"log"
"os"
"os/signal"
...
...
@@ -20,6 +21,7 @@ import (
func
main
()
{
var
cpuprofile
,
memprofile
,
mutexprofile
,
httpAddr
,
dataDir
string
var
udpRange
string
flag
.
StringVar
(
&
httpAddr
,
"http"
,
":8443"
,
"web server `address`"
)
flag
.
StringVar
(
&
webserver
.
StaticRoot
,
"static"
,
"./static/"
,
...
...
@@ -40,6 +42,8 @@ func main() {
"store memory profile in `file`"
)
flag
.
StringVar
(
&
mutexprofile
,
"mutexprofile"
,
""
,
"store mutex profile in `file`"
)
flag
.
StringVar
(
&
udpRange
,
"udp-range"
,
""
,
"UDP port `range`"
)
flag
.
BoolVar
(
&
group
.
UseMDNS
,
"mdns"
,
false
,
"gather mDNS addresses"
)
flag
.
BoolVar
(
&
ice
.
ICERelayOnly
,
"relay-only"
,
false
,
"require use of TURN relays for all media traffic"
)
...
...
@@ -47,6 +51,21 @@ func main() {
"built-in TURN server `address` (
\"\"
to disable)"
)
flag
.
Parse
()
if
udpRange
!=
""
{
var
min
,
max
uint16
n
,
err
:=
fmt
.
Sscanf
(
udpRange
,
"%v-%v"
,
&
min
,
&
max
)
if
err
!=
nil
{
log
.
Printf
(
"UDP range: %v"
,
err
)
os
.
Exit
(
1
)
}
if
n
!=
2
||
min
<=
0
||
max
<=
0
||
min
>
max
{
log
.
Printf
(
"UDP range: bad range"
)
os
.
Exit
(
1
)
}
group
.
UDPMin
=
min
group
.
UDPMax
=
max
}
if
cpuprofile
!=
""
{
f
,
err
:=
os
.
Create
(
cpuprofile
)
if
err
!=
nil
{
...
...
group/group.go
View file @
99026c0e
...
...
@@ -18,6 +18,7 @@ import (
var
Directory
string
var
UseMDNS
bool
var
UDPMin
,
UDPMax
uint16
var
ErrNotAuthorised
=
errors
.
New
(
"not authorised"
)
...
...
@@ -247,6 +248,11 @@ func APIFromCodecs(codecs []webrtc.RTPCodecCapability) (*webrtc.API, error) {
continue
}
}
if
UDPMin
>
0
&&
UDPMax
>
0
{
s
.
SetEphemeralUDPPortRange
(
UDPMin
,
UDPMax
)
}
return
webrtc
.
NewAPI
(
webrtc
.
WithSettingEngine
(
s
),
webrtc
.
WithMediaEngine
(
&
m
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment