AutoHotkey 2 can use Windows' WinHttpRequest COM object for a request with an explicit proxy:

request := ComObject("WinHttp.WinHttpRequest.5.1")
request.SetTimeouts(5000, 5000, 10000, 20000)
request.SetProxy(2, "proxy.example.net:8080", "localhost")
request.Open("GET", "https://example.net/status", false)
request.Send()
MsgBox request.Status " " request.StatusText

2 selects the supplied proxy configuration. For the public HTTPS check shown, the HTTP proxy list supplies candidate intermediary host/port values when public routes are permitted and no proxy credentials are configured. The optional third argument is the bypass list; here, localhost is direct.

The final false in Open selects a synchronous request. This small script waits for completion before reading the status. A longer-running desktop automation should account for that wait in its interaction flow.

If the proxy requires credentials, set them after Open and before Send:

request.SetCredentials(proxyUser, proxyPassword, 1)

The application supplies those two variables. The final flag, 1, selects proxy credentials. Flag 0 selects credentials for the destination server.

After a successful text response, request.ResponseText contains the returned text. Use ResponseBody and an appropriate binary-writing path for a binary download rather than sending those bytes through text conversion.

Mikanda mikatakata