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();
unsigned i;
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);
if (rfb::Server::stunServer[0]) {
if (strlen(rfb::Server::stunServer) < PATH_MAX)
tryserver(rfb::Server::stunServer, sock);
} 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);

View File

@ -221,6 +221,10 @@ rfb::StringParameter rfb::Server::publicIP
("publicIP",
"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
("udpFullFrameFrequency",

View File

@ -64,6 +64,7 @@ namespace rfb {
static IntParameter udpPort;
static StringParameter kasmPasswordFile;
static StringParameter publicIP;
static StringParameter stunServer;
static BoolParameter printVideoArea;
static BoolParameter protocol3_3;
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.
.
.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
Send a full frame every N frames for clients using UDP. 0 to disable. Default \fI0\fP.
.