UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.

Remove VTS Port number from URL and have it as a query string

Idea ID 2690085

Remove VTS Port number from URL and have it as a query string

The current implementation of VTS involves http://<VTSMachineName>:<VTSportNumber>

The security setup in our current DMZ does not allow any incoming request which are not on port 80 or 443 (HTTP & HTTPS).. This is an issue where we have 300-400 VTS ports to run all our performance tests.

The request is to have the port as query based string..

Ex:

http://<VTSMachineName>:80/?portnumber=<VTS Port Number>

https://<VTSMachineName>:443/?portnumber=<VTS Port Number>

 

This will be beneficial for us as we can use Microfocus hosted external LGs (London, Frankfurt, Toronto) and these LGs use VTS machines which are hosted within our private Cloud infrastructure.

@buczekj 

 

 

 

 

 

Tags (1)
13 Comments
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
Status changed to: Waiting for Votes
 
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

This can be implemented by Nginx port forwarding.

Nginx can listen on port 80, and redirect requests to different ports by checking the "location"

What you need to do is to setup a Nginx server which listens on port 80, start  your vts instances on different ports, configuring Nginx with mapping your requests to these ports

Cadet 1st Class
Cadet 1st Class

Thanks, Fei for your inputs. Had left this for a while and couldn't get back to your response.

Seems like a sensible response, but before implementing, had some queries (will try it out as well)

Currently it is like

http://myVTSIP:1003

http://myVTSIP:1004 (and so on)..

In my vugen script it is 

int rc = 0;
char *VtsServer = "<myVTSIP>";
int nPort = 1003;


rc = lrvtc_connect(VtsServer,nPort,VTOPT_KEEP_ALIVE);

and it works.. no issues..

Let's say we get Nginx and VTS installed in the same box. Nginx runs on 80 and VTS runs on multiple ports (For simplicity - 1003 & 1004). Now we update within Nginx location module, for request http://myVTSIP:80/1003 route it to http://myVTSIP:1003. This will solve the problem of accessing the webpage. 

But what I not able to catch, how much I need to change the loadrunner script. Would it be something like:

int rc = 0;
char *VtsServer = "<myVTSIP>";
int nPort = 80/1003;

Could please share some more details to help me progress?

Many Thanks,

Pratap

 

 

Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Hi Pratap, I previously misunderstood this issue. It is not resolved now, but is in developing now. In a future release, access to vts server will be send to 80/443 with the nominal port passed by query string. I will update it once this feature is released.

Micro Focus Expert
Micro Focus Expert
Status changed to: Accepted
 
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

There's a new feature in LR2020SP1:

Set AccessVTSPortByQueryString to 1 in default.cfg(under [General]), http request will be sent to 80 and https to 443 (you can also change the ports by setting VTSHTTPSAccessPort and VTSHTTPAccessPort in the same cfg file)

And user should also set up a reverse proxy on VTS server to redirect requests on 80 and 443. Here is an example for HTTP redirect configuration by Nginx:

server {

        listen       80;

        server_name  localhost;

 

        location / {

            if ($query_string ~* ^portnumber=(\d+)(.*)$) {

                                                            set $port $1;

                                                            set $para $2;

                                                            proxy_pass http://127.0.0.1:$port$para;

                                             }

                                             proxy_pass http://127.0.0.1;

        }

}

Micro Focus Expert
Micro Focus Expert

This new capability will be made available in LoadRunner Cloud in the coming release, planned for May 3, 2020. 

Lieutenant
Lieutenant

Hi

We have tried above solution.  but error page with CSS and JS missing.

 

In NGINX logs we're getting 

Page with CSS and JS missingPage with CSS and JS missing

 

2020/05/11 15:35:51 [error] 9316#3260: *485 CreateFile() "C:\AvivaNFT\Nginx\nginx-1.18.0\nginx-1.18.0/html/api" failed (2: The system cannot find the file specified), client: 10.86.4.118, server: localhost, request: "POST /api HTTP/1.1", host: "10.63.21.139"

2020/05/11 15:36:24 [error] 9316#3260: *488 CreateFile() "C:\AvivaNFT\Nginx\nginx-1.18.0\nginx-1.18.0/html/api" failed (2: The system cannot find the file specified), client: 10.86.4.118, server: localhost, request: "POST /api HTTP/1.1", host: "10.63.21.139"

2020/05/11 15:40:03 [error] 9316#3260: *503 CreateFile() "C:\AvivaNFT\Nginx\nginx-1.18.0\nginx-1.18.0/html/css/jquery-ui-1.10.3.custom.min.css" failed (3: The system cannot find the path specified), client: 10.63.22.75, server: localhost, request: "GET /css/jquery-ui-1.10.3.custom.min.css HTTP/1.1", host: "internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com", referrer: "http://internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com/?portnumber=4000"

2020/05/11 15:40:03 [error] 9316#3260: *505 CreateFile() "C:\AvivaNFT\Nginx\nginx-1.18.0\nginx-1.18.0/html/css/ui.jqgrid.css" failed (3: The system cannot find the path specified), client: 10.63.22.75, server: localhost, request: "GET /css/ui.jqgrid.css HTTP/1.1", host: "internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com", referrer: "http://internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com/?portnumber=4000"

2020/05/11 15:40:03 [error] 9316#3260: *503 CreateFile() "C:\AvivaNFT\Nginx\nginx-1.18.0\nginx-1.18.0/html/main.css" failed (2: The system cannot find the file specified), client: 10.63.22.75, server: localhost, request: "GET /main.css HTTP/1.1", host: "internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com", referrer: "http://internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com/?portnumber=4000"

2020/05/11 15:40:03 [error] 9316#3260: *503 CreateFile() "C:\AvivaNFT\Nginx\nginx-1.18.0\nginx-1.18.0/html/js/jquery-ui-1.10.3.custom.min.js" failed (3: The system cannot find the path specified), client: 10.63.22.75, server: localhost, request: "GET /js/jquery-ui-1.10.3.custom.min.js HTTP/1.1", host: "internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com", referrer: "http://internal-techservicenftvts-856725693.eu-west-1.elb.amazonaws.com/?portnumber=4000"

 

Also, we're not able to connect to run the script through Vugen. Below steps checked. 

VUgen version : 12.63

To enable VTS port forwarding:

  1. Configure the VTS server to support port forwarding.

  2. Enable port forwarding in TruClient.

    1. In the script folder, open the default.cfg file and set AccessVTSPortByQueryString=1 (in the "General" section).

    2. Change the port to one that your VTS server can open for inbound communications (the default ports are 80 for HTTP and 443 for HTTPS).

      • For HTTP: Change the value in VTSHTTPAccessPort to match the port that the VTS server is using (if it is not using port 80).
      • For HTTPS: Change the value in VTSHTTPSAccessPort to match the port that the VTS server is using (if it is not using port 443).

      For example, if your VTS server cannot open port 80, but can open port 8080, change the port value in VTSHTTPAccessPort to “8080”.

  3. Use the existing VTS API to connect to your VTS server.

Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Hi Pradeep,

This a new feature from LR2020SP1. It's not included in 12.63.

Regards,

Phillip

Lieutenant
Lieutenant

errorerrorThanks Philip. We got the Vugen issue sorted by using Vugen 2020.1.0 version though we still have the issue in getting data  and CSS load while using along with Nginx.

Please look into the attachment.  Above comment has the error message. 

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.