|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > HTP. - Command > !HTP-General - General HTTP operations and utilities > !Utility - Helper functions for HTTP operations (string conversion, proxy toggling) > HTP. - HTTP Operations |
SPR Script Language
HTP.UseProxy
Enables or disables proxy usage for HTTP operations.
Intention
The HTP.UseProxy command in SPR toggles whether HTTP operations, like HTP.Request or HTP.ReqShort, use a proxy. You can specify an enable flag ($$EN as 0, 1, or -1), or omit it to disable proxy use by default. This controls whether your script routes HTTP traffic through a configured proxy server.
It’s your robot’s proxy switch—HTP.UseProxy turns proxy routing on or off for HTTP tasks.
Illustration
🔛 Enable: HTP.UseProxy|1 turns proxy use on.
🔚 Disable: HTP.UseProxy turns proxy use off.
Syntax
HTP.UseProxy[|$$EN]
Parameter Explanation
P1 - $$EN - (Variable, Numeric, Optional)
The proxy enable flag (e.g., $$EN as "0", "1", or "-1"). If 0 or omitted, disables proxy; if 1, enables proxy; if -1, uses the last setting stored in g_proxyEnabled.
Examples
'***********************************
' HTP.UseProxy - Sample 1: Enable Proxy
'***********************************
HTP.UseProxy|1
MBX.Proxy enabled for HTTP operations
HTP.Request|GET|https://example.com|||0|0|0|$$RES
MBX.Ready
'
'***********************************
' HTP.UseProxy - Sample 2: Disable Proxy
'***********************************
HTP.UseProxy|0
PRT.Proxy disabled
MBX.Ready
'
'***********************************
' HTP.UseProxy - Sample 3: Use Last Setting
'***********************************
HTP.UseProxy|-1
MBX.Proxy set to last state
MBX.Ready
'
Remarks
- Enables or disables proxy use for subsequent HTTP operations.
- Use with HTP.SetProxy to configure proxy details first.
- $$EN=-1 reverts to the previous state stored in g_proxyEnabled.
Limitations
- No success confirmation; assumes HTP_SetProxyOn succeeds.
- Proxy must be configured separately with HTP.SetProxy.
See also: