Showing results for 
Search instead for 
Did you mean: 

Setting up a proxy for ZXTM

Occasional Contributor

Setting up a proxy for ZXTM

I'am setting up a ZXTM reverse proxy (code below) in order to access an external site.

$path = http.getPath(); 

        $contents = resource.get("");

$proxyList = string.split( $contents, "\n" );

foreach( $prop in $proxyList ) {

   if( string.regexMatch( $prop, "(.+)=(.+)Smiley Sad[0-9]+)" )) {        

      $configuredPath = string.trim($1);


      if( string.startsWithI($path, $configuredPath)) {   

         $host = string.unescape(string.trim($2));          

         http.setHeader( "Host", $host);


         $port = string.unescape(string.trim($3));

         pool.use("PROXY", $host, $port);




Here the PROXY pool is a 'dummy' one and I have a file whose entries are of the format


This rule is working fine, however I cannot use this rule because the ZXTM box doesn't have connectivity to this external/public site. Therefore its suggested to use a proxy server ( i.e. for accessing this external site ( along with this rule.)

My question is - is it possible to let ZXTM access a particular URL via a proxy server (To make connection to externalUrl  via - like we enable proxy settings for browsers)? Else is there any workaround?


Re: Setting up a proxy for ZXTM

You want to use another reverse proxy server. It will connect to your actual origin, and you will use it as your ZXTM pool.


Re: Setting up a proxy for ZXTM

Hi Fahim,

If you are pushing everything through a proxy, then you can remove the forward proxy "pool.use(pool, host, port) and replace with pool.use(proxypool). Then specify the proxy(ies) in the pool itself.

You will also need to convert the standard HTTP requests into proxy ones. For example if your request is for "/bar.jsp" and you want to use the external host "" then you should set that in the path with http.setPath(). You might also want to set a proxy-connection header. EG http.setHeader("Proxy-Connection", "Keep-Alive"). The proxy will then do the rest.