get_current_proxy

get_current_proxy($connection); - get the proxy used for the specified network connection

The function accepts parameters as input:

  • $connection – name of the connection (you can find it in the properties of network connections)

    After testing, the function returns the result of its work to the script :
  • Proxy used – proxy used by the specified network
  • empty string – if the proxy is not used or there is no such connection

    PHP example: connection->".basename(__FILE__)."
    "; //proxy $proxy = "120.28.45.202:8090"; //1 echo "1.Let's set a proxy for connections:"; echo $connection->enable_proxy("all connections", $proxy)."
    "; //2 echo "2.Let's set the maximum waiting time for navigation:"; echo $browser->set_wait_params(10,1)."
    "; //3 echo "3.Let's go to whoer.net(let's see our ip):"; echo $browser->navigate("http://whoer.net")."
    "; //4 echo "4.Get the current proxy:"; echo $connection->get_current_proxy("all connections")."
    "; //five echo "5.Remove the proxy(now you can set a new proxy):"; echo $connection->disable_proxy("all connections")."
    "; //6 echo "6.Get the current proxy:"; if($connection->get_current_proxy("all connections") == ""); echo "connection works now without proxy"; //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # Start echo("
    connection.xxxxxxxxx
    ") #proxy proxy = "180.254.177.251:80" # 1 echo("1.Set a proxy for connections:") echo(connection.enable_proxy("all connections", proxy), "
    ") # 2 echo("2.Set the maximum waiting time for navigation:") echo(browser.set_wait_params(10,1), "
    ") # 3 echo("3.Go to whoer.net(see our ay-pi):") echo(browser.navigate("http://whoer.net"), "") echo(connection.get_real_ip() + " ") # 4 echo("4.Get the current proxy:") echo(connection.get_current_proxy("all connections"), "
    ") # five echo("5.Remove the proxy(now you can set a new proxy):") echo(connection.disable_proxy("all connections"), "
    ") # 6 echo("6.Get the current proxy:") if connection.get_current_proxy("all connections") == "": echo("connection works now without proxy") # end echo("

    ") # Quit app.quit()
    C# example: #region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program: XHEScript { static void Main(string [] args) { //init XHE server = "127.0.0.1:7010"; InitXHE(); //Start echo("
    connection.get_current_proxy
    "); //1 step echo("1.Get the first proxy from fineproxy.org:"); echo(browser.navigate("http://fineproxy.org") + "-("); string proxy = webpage.get_body_inter_prefix(" Fast proxies:
    ", "
    ", true); echo(proxy); //step 2 echo(")
    2.Let's set a proxy:"); echo(connection.enable_proxy("all connections", proxy) + "
    "); //step 3 echo("3.Let's set the maximum waiting time for navigation:"); echo(browser.set_wait_params(10,1) + "
    "); //step 4 echo("4.Let's go to whoer.net(let's see our ip):"); echo(browser.navigate("http://whoer.net") + "
    "); //step 5 echo("5.Get the current proxy:"); echo(connection.get_current_proxy("all connections") + "
    "); //step 6 echo("6.Remove the proxy(now you can set a new proxy):"); echo(connection.disable_proxy("all connections") + "
    "); //step 7 echo("7.Get the current proxy:"); if(connection.get_current_proxy("all connections") == ""); echo("human works now without a proxy"); //end echo("

    "); app.quit(); } }
    Java Script example: //connect the object to control the emulator, if not already connected xhe_host = "127.0.0.1:7010"; echo = require("../../../Templates JS/xweb_human_emulator.js"); //Start echo("
    connection.get_current_proxy
    "); //1 step echo("1.Get the first proxy from fineproxy.org:"); echo(browser.navigate("http://fineproxy.org") + "-("); var proxy = webpage.get_body_inter_prefix(" Fast proxies:
    ", "
    ", true) echo(proxy); //step 2 echo(")
    2.Let's set a proxy:"); echo(connection.enable_proxy("all connections", proxy) + "
    "); //step 3 echo("3.Let's set the maximum waiting time for navigation:"); echo(browser.set_wait_params(10,1) + "
    "); //step 4 echo("4.Let's go to whoer.net(let's see our ip):"); echo(browser.navigate("http://whoer.net") + "
    "); //step 5 echo("5.Get the current proxy:"); echo(connection.get_current_proxy("all connections") + "
    "); //step 6 echo("6.Remove the proxy(now you can set a new proxy):"); echo(connection.disable_proxy("all connections") + "
    "); //step 7 echo("7.Get the current proxy:"); if(connection.get_current_proxy("all connections") == ""); echo("human works now without a proxy"); //end echo("

    "); //Quit app.quit();