-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUACAMOLE-1167: Add server settings for RD gateway type. #559
Open
necouchman
wants to merge
1
commit into
apache:main
Choose a base branch
from
necouchman:jira/1167
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,7 @@ const char* GUAC_RDP_CLIENT_ARGS[] = { | |
|
||
"gateway-hostname", | ||
"gateway-port", | ||
"gateway-type", | ||
"gateway-domain", | ||
"gateway-username", | ||
"gateway-password", | ||
|
@@ -632,6 +633,13 @@ enum RDP_ARGS_IDX { | |
* effect. FreeRDP instead uses a hard-coded value of 443. | ||
*/ | ||
IDX_GATEWAY_PORT, | ||
|
||
/** | ||
* Explicitly set the mode for the RDP gateway. This can either be set to | ||
* auto, in which case the RDP client will attempt to auto-detect the mode, | ||
* or can be forced to either HTTP or RPC. | ||
*/ | ||
IDX_GATEWAY_TYPE, | ||
|
||
/** | ||
* The domain of the user authenticating with the remote desktop gateway, | ||
|
@@ -1263,6 +1271,20 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user, | |
settings->gateway_port = | ||
guac_user_parse_args_int(user, GUAC_RDP_CLIENT_ARGS, argv, | ||
IDX_GATEWAY_PORT, 443); | ||
|
||
char* gateway_type = guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, | ||
argv, IDX_GATEWAY_TYPE, NULL); | ||
|
||
if (strcmp(gateway_type, "auto") == 0) | ||
settings->gateway_type = GUAC_RDP_GATEWAY_AUTO; | ||
|
||
else if (strcmp(gateway_type, "http") == 0) | ||
settings->gateway_type = GUAC_RDP_GATEWAY_HTTP; | ||
|
||
else if (strcmp(gateway_type, "rpc") == 0) | ||
settings->gateway_type = GUAC_RDP_GATEWAY_RPC; | ||
|
||
free(gateway_type); | ||
|
||
/* Set gateway domain */ | ||
settings->gateway_domain = | ||
|
@@ -1960,7 +1982,29 @@ void guac_rdp_push_settings(guac_client* client, | |
rdp_settings->GatewayDomain = guac_strdup(guac_settings->gateway_domain); | ||
rdp_settings->GatewayUsername = guac_strdup(guac_settings->gateway_username); | ||
rdp_settings->GatewayPassword = guac_strdup(guac_settings->gateway_password); | ||
|
||
|
||
/* Check RD gateway type setting and set options appropriately. */ | ||
switch(guac_settings->gateway_type) { | ||
|
||
/* Gateway is set to auto, so enable either transport. */ | ||
case GUAC_RDP_GATEWAY_AUTO: | ||
rdp_settings->GatewayHttpTransport = TRUE; | ||
rdp_settings->GatewayRpcTransport = TRUE; | ||
break; | ||
|
||
/* Gateway is forced to HTTP, so only enable HTTP transport. */ | ||
case GUAC_RDP_GATEWAY_HTTP: | ||
rdp_settings->GatewayHttpTransport = TRUE; | ||
rdp_settings->GatewayRpcTransport = FALSE; | ||
break; | ||
|
||
/* Gateway is forced to RPC, so only enable RPC transport. */ | ||
case GUAC_RDP_GATEWAY_RPC: | ||
rdp_settings->GatewayHttpTransport = FALSE; | ||
rdp_settings->GatewayRpcTransport = TRUE; | ||
Comment on lines
+1991
to
+2004
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add a block in the freerdp3 part ( freerdp_settings_set_bool(rdp_settings, FreeRDP_GatewayHttpTransport, TRUE)
freerdp_settings_set_bool(rdp_settings, FreeRDP_GatewayRpcTransport, TRUE) |
||
break; | ||
} | ||
|
||
} | ||
|
||
/* Store load balance info (and calculate length) if provided */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if this isn't set to any of these values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more clear, it'd be nice if there was some documentation somewhere in here that briefly explains what happens in the default case where the
gateway-type
parameter isn't set (or is set to some invalid value).