对特定的代理使用JMeter代理来记录请求 [英] Use JMeter Proxy against specific Proxy to record requests

查看:76
本文介绍了对特定的代理使用JMeter代理来记录请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应通过代理Proxy_A启动的电子应用程序.我想对后端进行负载测试.根据我的基本理解,当我想使用JMeter记录请求时,我应该配置一个脚本记录器,该脚本记录器自己创建一个代理Proxy_B.然后,我应该使用JMeter代理作为我的应用程序的代理,以便可以记录流量.现在我有点迷路了.我如何告诉JMeter接受请求并将其从我的Proxy_A转发到JMeter代理Proxy_B?

I have an Electron App which should be started through Proxy Proxy_A. I Would like to make a Loadtest to the Backend. To my basic understanding when I want to record the request using JMeter, I should configure a script recorder which creates a proxy Proxy_B on its own. I should then use JMeter proxy as a proxy to my app so that the traffic could be recorded. Now I am little bit lost. How could I tell JMeter to accepts and forwards the request from my Proxy_A to JMeter Proxy Proxy_B?

编辑感谢Dmitri T

Edit thanks to Dmitri T

我要执行的操作如随附的屏幕截图所述

What I am trying to do is described as per the attached screenshot

当我根据代理启动JMeter时

When I start JMeter with the proxy as per

jmeter -E https -H ACTUAL_PROXY_URL -P ACTUAL_PROXY_PORT

,然后启动JMeter Proxy来记录来自localhost:9000的请求

and I start the JMeter Proxy to record requests from localhost:9000

然后,当我开始记录时,我无法记录请求.当我将浏览器指向localhost:9000时,我就变成了错误

Then I can not record requests when I start recording. When I point my browser to localhost:9000 I become the error

500 Internal server error

推荐答案

为了能够记录从Electron应用程序到后端的流量,您需要在Electron应用程序和后端之间传递JMeter,例如:

In order to be able to record traffic from the Electron app to the backend you need to pass JMeter between the Electron app and the backend, for example:

  1. Electron App -> JMeter -> Proxy_A -> Backend
  2. Electron App -> Proxy_A -> JMeter -> Backend
  1. Electron App -> JMeter -> Proxy_A -> Backend
  2. or Electron App -> Proxy_A -> JMeter -> Backend

确切的说明会根据使用的方法和软件而有所不同,即,如果可以为Electron应用程序配置代理服务器,则可以将其设置为使用JMeter和

Exact instructions will differ depending on the approach and the software you use, i.e. if it's possible to configure the proxy server for the Electron app you can set it to use JMeter and configure JMeter to use Proxy_A as the upstream proxy

如果可以将Proxy_A配置为使用某些上游代理,只需将其指向JMeter的主机/端口组合即可.

If it's possible to configure Proxy_A to use some upstream proxy just point it to JMeter's host/port combination.

另外,您可能需要执行以下步骤:

Also you might need to perform the following steps:

  1. 将JMeter的自签名证书导入您的代理或操作系统,这样JMeter便可以解密安全流量
  2. 在操作系统级别设置代理
  3. 如果要在同一台物理Windows计算机上运行Electron应用程序和JMeter,则可能需要安装
  1. Import JMeter's self-signed certificate to your proxy or OS so JMeter would be able to decrypt secure traffic
  2. Set up proxy on OS level
  3. If you will be running the Electron app and JMeter on the same physical Windows machine you might need to install loopback adapter

有关上述步骤的更多信息:如何使用JMeter运行桌面应用程序的性能测试

More information on the above steps: How to Run Performance Tests of Desktop Applications Using JMeter

这篇关于对特定的代理使用JMeter代理来记录请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆