|
@@ -234,6 +234,12 @@ type Config struct {
|
|
|
// status, etc. This is used for special case temporary tunnels (Windows VPN mode).
|
|
// status, etc. This is used for special case temporary tunnels (Windows VPN mode).
|
|
|
DisableApi bool
|
|
DisableApi bool
|
|
|
|
|
|
|
|
|
|
+ // TargetApiProtocol specifies whether to force use of "ssh" or "web" API protocol.
|
|
|
|
|
+ // When blank, the default, the optimal API protocol is used. Note that this
|
|
|
|
|
+ // capability check is not applied before the "CandidateServers" count is emitted.
|
|
|
|
|
+ // This parameter is intended for testing and debugging only.
|
|
|
|
|
+ TargetApiProtocol string
|
|
|
|
|
+
|
|
|
// DisableRemoteServerListFetcher disables fetching remote server lists. This is
|
|
// DisableRemoteServerListFetcher disables fetching remote server lists. This is
|
|
|
// used for special case temporary tunnels.
|
|
// used for special case temporary tunnels.
|
|
|
DisableRemoteServerListFetcher bool
|
|
DisableRemoteServerListFetcher bool
|
|
@@ -470,6 +476,11 @@ func LoadConfig(configJson []byte) (*Config, error) {
|
|
|
errors.New("HostNameTransformer interface must be set at runtime"))
|
|
errors.New("HostNameTransformer interface must be set at runtime"))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if !common.Contains([]string{"", "ssh", "web"}, config.TargetApiProtocol) {
|
|
|
|
|
+ return nil, common.ContextError(
|
|
|
|
|
+ errors.New("invalid TargetApiProtocol"))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if config.UpgradeDownloadUrl != "" &&
|
|
if config.UpgradeDownloadUrl != "" &&
|
|
|
(config.UpgradeDownloadClientVersionHeader == "" || config.UpgradeDownloadFilename == "") {
|
|
(config.UpgradeDownloadClientVersionHeader == "" || config.UpgradeDownloadFilename == "") {
|
|
|
return nil, common.ContextError(errors.New(
|
|
return nil, common.ContextError(errors.New(
|