Merge branch 'feature/KASM-2837_STUN_srv_setting' into 'master'

Add -stunServer arg for on-premises STUN

Closes KASM-2837

See merge request kasm-technologies/internal/KasmVNC!57
This commit is contained in:
Anthony Merrill 2022-08-14 15:51:23 +00:00
commit 5e2a8b45da
4 changed files with 20 additions and 4 deletions

View File

@ -170,10 +170,15 @@ void getPublicIP() {
abort(); abort();
unsigned i; unsigned i;
for (i = 0; i < sizeof(servers) / sizeof(servers[0]); i++) { if (rfb::Server::stunServer[0]) {
if (tryserver(servers[i], sock)) if (strlen(rfb::Server::stunServer) < PATH_MAX)
break; tryserver(rfb::Server::stunServer, sock);
vlog.info("STUN server %u didn't work, trying next...", i); } else {
for (i = 0; i < sizeof(servers) / sizeof(servers[0]); i++) {
if (tryserver(servers[i], sock))
break;
vlog.info("STUN server %u didn't work, trying next...", i);
}
} }
close(sock); close(sock);

View File

@ -221,6 +221,10 @@ rfb::StringParameter rfb::Server::publicIP
("publicIP", ("publicIP",
"The server's public IP, for UDP negotiation. If not set, will be queried via the internet.", "The server's public IP, for UDP negotiation. If not set, will be queried via the internet.",
""); "");
rfb::StringParameter rfb::Server::stunServer
("stunServer",
"Use this STUN server for querying the server's public IP. If not set, a hardcoded list is used.",
"");
rfb::IntParameter rfb::Server::udpFullFrameFrequency rfb::IntParameter rfb::Server::udpFullFrameFrequency
("udpFullFrameFrequency", ("udpFullFrameFrequency",

View File

@ -64,6 +64,7 @@ namespace rfb {
static IntParameter udpPort; static IntParameter udpPort;
static StringParameter kasmPasswordFile; static StringParameter kasmPasswordFile;
static StringParameter publicIP; static StringParameter publicIP;
static StringParameter stunServer;
static BoolParameter printVideoArea; static BoolParameter printVideoArea;
static BoolParameter protocol3_3; static BoolParameter protocol3_3;
static BoolParameter alwaysShared; static BoolParameter alwaysShared;

View File

@ -127,6 +127,12 @@ The server's public IP, for UDP negotiation. If not set, will be queried via the
Default unset. Default unset.
. .
.TP .TP
.B \-StunServer \fIsrv\fP
Use this STUN server for querying the server's public IP. If not set, a hardcoded list of
STUN servers is used.
Default unset.
.
.TP
.B \-udpFullFrameFrequency \fIframes\fP .B \-udpFullFrameFrequency \fIframes\fP
Send a full frame every N frames for clients using UDP. 0 to disable. Default \fI0\fP. Send a full frame every N frames for clients using UDP. 0 to disable. Default \fI0\fP.
. .