Skip to content

Commit

Permalink
new WinHttpForceProxyDetection global flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Nov 30, 2023
1 parent e4fa1f3 commit 53de10b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
@@ -1 +1 @@
'2.1.6338'
'2.1.6339'
10 changes: 9 additions & 1 deletion src/net/mormot.net.client.pas
Expand Up @@ -935,6 +935,13 @@ TWinHttpWebSocketClient = class
destructor Destroy; override;
end;

var
/// global flag to enable HTTP proxy detection at OS level for TWinHttp
// - as if Windows 8.1 and newer is detected
// - may be useful if {$R Vista.res} manifest is not available in the project,
// so only Windows 7 is detected by the executable
WinHttpForceProxyDetection: boolean;

{$endif USEWININET}

{$ifdef USELIBCURL}
Expand Down Expand Up @@ -2492,7 +2499,8 @@ procedure TWinHttp.InternalConnect(ConnectionTimeOut, SendTimeout, ReceiveTimeou
begin
WinHttpApiInitialize;
if fProxyName = '' then
if OSVersion >= wEightOne then
if (OSVersion >= wEightOne) or
WinHttpForceProxyDetection then
access := WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY // Windows 8.1 and newer
else
access := WINHTTP_ACCESS_TYPE_NO_PROXY
Expand Down

0 comments on commit 53de10b

Please sign in to comment.