|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > HTP. - Command > !HTP-General - General HTTP operations and utilities > !Configuration - Commands for setting up HTTP environment (timeouts, headers, proxy) > HTP. - HTTP Operations |
SPR Script Language
HTP.SetProxy
Configures the proxy server and bypass list for HTTP operations.
Intention
The HTP.SetProxy command in SPR sets the proxy server details for HTTP operations, such as HTP.Request or HTP.ReqShort. You specify the proxy name ($$NAME) and an optional bypass list ($$BYPASS) to define which servers to route through the proxy and which to skip. This configures how your script accesses the web via a proxy.
It’s your robot’s proxy planner—HTP.SetProxy maps out the route for HTTP traffic.
Illustration
🌐 Proxy: HTP.SetProxy|proxy.example.com sets the proxy server.
🚫 Bypass: HTP.SetProxy|proxy.example.com|localhost;*.local skips local addresses.
Syntax
HTP.SetProxy|$$NAME|$$BYPASS
Parameter Explanation
P1 - $$NAME - (Variable, String)
The proxy server address (e.g., $$NAME as "proxy.example.com:8080"). Required; use "last" to reuse the previous setting from g_proxyName.
P2 - $$BYPASS - (Variable, String, Optional)
The bypass list (e.g., $$BYPASS as "localhost;*.local"). Specifies addresses to skip the proxy; use "last" to reuse g_proxyBypass; if omitted, clears the bypass list.
Examples
'***********************************
' HTP.SetProxy - Sample 1: Set Proxy Server
'***********************************
HTP.SetProxy|proxy.example.com:8080
MBX.Proxy set to proxy.example.com:8080
HTP.UseProxy|1
MBX.Ready
'
'***********************************
' HTP.SetProxy - Sample 2: Set Proxy with Bypass
'***********************************
HTP.SetProxy|proxy.example.com:8080|localhost;*.local
PRT.Proxy set with bypass for local addresses
HTP.UseProxy|1
MBX.Ready
'
'***********************************
' HTP.SetProxy - Sample 3: Reuse Last Settings
'***********************************
HTP.SetProxy|last|last
MBX.Proxy reset to previous name and bypass
MBX.Ready
'
Remarks
- Configures the proxy server and bypass list for subsequent HTTP operations.
- Use HTP.UseProxy to enable the configured proxy.
- "last" reuses previous settings from g_proxyName or g_proxyBypass.
Limitations
- No success confirmation; assumes HTP_SetProxy succeeds.
- Proxy must be enabled separately with HTP.UseProxy.
See also: