CN113708992A - Reverse proxy test method, device, electronic equipment and storage medium - Google Patents

Reverse proxy test method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113708992A
CN113708992A CN202110929893.8A CN202110929893A CN113708992A CN 113708992 A CN113708992 A CN 113708992A CN 202110929893 A CN202110929893 A CN 202110929893A CN 113708992 A CN113708992 A CN 113708992A
Authority
CN
China
Prior art keywords
request
result
server
reverse proxy
data resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110929893.8A
Other languages
Chinese (zh)
Other versions
CN113708992B (en
Inventor
蔺宪武
黄瑶
张晓峰
凌杰
叶兵
李沁春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhou Lvmeng Chengdu Technology Co ltd
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Original Assignee
Shenzhou Lvmeng Chengdu Technology Co ltd
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhou Lvmeng Chengdu Technology Co ltd, Nsfocus Technologies Inc, Nsfocus Technologies Group Co Ltd filed Critical Shenzhou Lvmeng Chengdu Technology Co ltd
Priority to CN202110929893.8A priority Critical patent/CN113708992B/en
Publication of CN113708992A publication Critical patent/CN113708992A/en
Application granted granted Critical
Publication of CN113708992B publication Critical patent/CN113708992B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a reverse proxy test method, a device, electronic equipment and a storage medium, wherein the reverse proxy test method comprises the following steps: the reverse proxy server sends a first data resource request to a connected target back-end server through a northbound interface to obtain a first request result; sending a second data resource request to a connected appointed back-end server through a southbound interface to obtain a second request result; receiving a third data resource request sent by a client, sending the third data resource request to the target back-end server, and obtaining a third request result; and determining a reverse proxy test result according to the first request result, the second request result and the third request result, so that the accuracy and the test efficiency of the reverse proxy connectivity test are improved.

Description

Reverse proxy test method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data communications, and in particular, to a reverse proxy test method and apparatus, an electronic device, and a storage medium.
Background
The reverse proxy is that after receiving a request from a client, a reverse proxy server obtains a data resource requested by the client from a corresponding back-end server (e.g., a Web server), and then returns the data resource to the client, so that the client only knows an IP (Internet Protocol) address of the reverse proxy server, and the Web server is invisible to the outside, thereby ensuring the security of the data resource of the Web server. Reverse proxies, by which Web services can be provided without exposing a Web server, are often used to control Web site traffic.
However, due to the complexity of the network, reverse proxy services are not available for various reasons during reverse proxy server access and use. Currently, the following reverse proxy test methods are often used to test the connectivity of a reverse proxy server: the client directly accesses the Web server, and the client accesses the Web server through the reverse proxy server and compares the results of the two access modes to judge whether the connectivity of the reverse proxy server is abnormal. However, if the Web server is normally accessed directly by the client and the Web server is abnormally accessed by the client through the reverse proxy server, there is a certain probability that the Web server itself is abnormal when the Web server is accessed through the reverse proxy server, but the reverse proxy server itself is abnormal, so that the connectivity of the reverse proxy server is determined to be abnormal directly, which may cause misjudgment, and thus, the test accuracy of the reverse proxy test method is not high.
Disclosure of Invention
In order to solve the problem that the existing connectivity test mode of the reverse proxy is not high in accuracy, embodiments of the present invention provide a reverse proxy test method, apparatus, electronic device, and storage medium.
In a first aspect, an embodiment of the present invention provides a reverse proxy testing method, including:
the reverse proxy server sends a first data resource request to a connected target back-end server through a northbound interface to obtain a first request result;
sending a second data resource request to a connected appointed back-end server through a southbound interface to obtain a second request result;
receiving a third data resource request sent by a client, sending the third data resource request to the target back-end server, and obtaining a third request result;
and determining a reverse proxy test result according to the first request result, the second request result and the third request result.
In a possible implementation manner, the designated backend server includes at least a first backend server and a second backend server, and the target backend server is any one of the first backend server and the second backend server.
In a possible implementation manner, sending a second data resource request to a connected specified backend server through a southbound interface to obtain a second request result specifically includes:
sending the second data resource request to the first back-end server through a southbound interface to obtain a first result in second request results;
and sending the second data resource request to the second back-end server through a southbound interface to obtain a second result in the second request result.
In a possible implementation manner, determining a reverse proxy test result according to the first request result, the second request result, and the third request result specifically includes:
when the first request result is determined to be normal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is normal, determining that the communication of the reverse proxy server is normal;
when determining that a first result in the second request results is abnormal, determining that the reverse proxy server is abnormal when accessing the first back-end server; when a second result in the second request result is abnormal, determining that the reverse proxy server is abnormal when accessing the second back-end server;
when determining that a first result in the second request results is normal, a second result in the second request results is normal, and the first request result is abnormal, determining that the proxy process of the proxy server is abnormal;
and when the first request result is determined to be abnormal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is determined to be abnormal, determining that the configuration of the northbound interface network of the reverse proxy server is abnormal.
In a possible implementation manner, the receiving a third data resource request sent by a client specifically includes:
and the reverse proxy server receives a third data resource request sent by the client through the northbound interface.
In a second aspect, an embodiment of the present invention provides a reverse proxy test apparatus, including:
the first test unit is used for sending a first data resource request to a connected target back-end server through a northbound interface to obtain a first request result;
the second test unit is used for sending a second data resource request to the connected appointed back-end server through the southbound interface to obtain a second request result;
the third test unit is used for receiving a third data resource request sent by a client, sending the third data resource request to the target back-end server and obtaining a third request result;
and the determining unit is used for determining a reverse proxy test result according to the first request result, the second request result and the third request result.
In a possible implementation manner, the designated backend server includes at least a first backend server and a second backend server, and the target backend server is any one of the first backend server and the second backend server.
In a possible implementation manner, the second testing unit is specifically configured to send the second data resource request to the first backend server through a southbound interface, and obtain a first result in second request results; and sending the second data resource request to the second back-end server through a southbound interface to obtain a second result in the second request result.
In a possible implementation manner, the determining unit is specifically configured to determine that the connection of the reverse proxy server is normal when it is determined that the first request result is normal, the first result of the second request results is normal, the second result of the second request results is normal, and the third request result is normal; when determining that a first result in the second request results is abnormal, determining that the reverse proxy server is abnormal when accessing the first back-end server; when a second result in the second request result is abnormal, determining that the reverse proxy server is abnormal when accessing the second back-end server; when determining that a first result in the second request results is normal, a second result in the second request results is normal, and the first request result is abnormal, determining that the proxy process of the proxy server is abnormal; and when the first request result is determined to be abnormal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is determined to be abnormal, determining that the configuration of the northbound interface network of the reverse proxy server is abnormal.
In a possible implementation manner, the third testing unit is specifically configured to receive, by the reverse proxy server, a third data resource request sent by the client through the northbound interface.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the reverse proxy testing method according to the present invention when executing the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the reverse proxy testing method according to the present invention.
The embodiment of the invention has the following beneficial effects:
in the reverse proxy testing method, apparatus, electronic device and storage medium provided in the embodiments of the present invention, a reverse proxy server sends a first data resource request to a target backend server connected through a northbound interface to obtain a first request result, the reverse proxy server sends a second data resource request to a designated backend server connected through a southbound interface to obtain a second request result, the reverse proxy server receives a third data resource request sent by a client, sends the third data resource request to the target backend server to obtain a third request result, and further determines a reverse proxy testing result jointly according to the first request result, the second request result and the third request result, compared to the prior art, in the embodiments of the present invention, the reverse proxy server accesses the connected backend server through the northbound interface and the southbound interface respectively, the method comprises the steps of accessing a back-end server through a reverse proxy server in combination with a client, detecting the connectivity of the reverse proxy server according to the three access modes, and judging the connectivity of the reverse proxy server by synthesizing request results of data resources corresponding to the three access modes, so that when the connectivity of the reverse proxy server is abnormal, the abnormal reason can be positioned more quickly and accurately, invalid investigation caused by problem positioning errors is avoided, the accuracy of reverse proxy connectivity test is improved, and meanwhile, the test efficiency is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic view of an application scenario of a reverse proxy testing method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of a reverse proxy testing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a reverse proxy test apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to solve the problem that the existing connectivity test mode of the reverse proxy is not high in accuracy, embodiments of the present invention provide a reverse proxy test method, apparatus, electronic device, and storage medium.
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are merely for illustrating and explaining the present invention, and are not intended to limit the present invention, and that the embodiments and features of the embodiments in the present invention may be combined with each other without conflict.
Referring to fig. 1, which is a schematic view of an application scenario of the reverse proxy testing method according to an embodiment of the present invention, the application scenario may include a client 10, a reverse proxy server 11, a backend server 12-1, and a backend server 12-2, where the client 10 is connected to the reverse proxy server 11 through a network, the reverse proxy server 11 is connected to the backend servers 12-1 and 12-2 through the network, and the backend servers 12-1 and 12-2 may be any servers providing data services, such as a Web server, which is not limited In this embodiment of the present invention, and the reverse proxy server 11 includes a north interface (In) and a south interface (Out). When the client 10 requests the data resource of the back-end server 12-1 or 12-2 from the reverse proxy server 11, the reverse proxy server 11 obtains the data resource requested by the client 10 from the back-end server 12-1 or 12-2 and returns the data resource to the client 10, so as to provide the reverse proxy service for the client 10. The number of the backend servers connected to the reverse proxy server 11 may be several, and the embodiment of the present invention is described by taking the example that the reverse proxy server 11 is connected to two backend servers 12-1 and 12-2.
Among them, the client 10 may be, but is not limited to: smart phones, tablet computers, notebook computers, desktop computers, and the like. The servers 12-1 and 12-2 may be independent physical servers, or may also be cloud servers that provide basic cloud computing services such as a cloud server, a cloud database, and cloud storage, which are not limited in the embodiment of the present invention.
Based on the above application scenarios, an exemplary embodiment of the present invention will be described in more detail below with reference to fig. 2, it should be noted that the above application scenarios are only shown for facilitating understanding of the spirit and principle of the present invention, and the embodiments of the present invention are not limited thereto. Rather, embodiments of the present invention may be applied to any scenario where applicable.
As shown in fig. 2, which is a schematic diagram of an implementation flow of a reverse proxy testing method provided in an embodiment of the present invention, the reverse proxy testing method may be applied to the reverse proxy server 11, and specifically may include the following steps:
s21, the reverse proxy server sends a first data resource request to the connected target back-end server through the northbound interface, and a first request result is obtained.
In specific implementation, the reverse proxy server 11 may actively access a connected target backend server to initiate active probing, where the backend server at least includes a first backend server (i.e., backend server 12-1) and a second backend server (i.e., backend server 12-2), and the target backend server is any one of the first backend server and the second backend server, that is: the target backend server is any one of the backend server 12-1 and the backend server 12-2.
Specifically, the reverse proxy server 11 sends a first data resource request to the connected backend server 12-1 or 12-2 through its northbound interface, and obtains a first request result to check whether the backend server 12-1 or 12-2 can be normally accessed through the northbound interface. The first data Resource request carries a requested data Resource identifier, such as a Uniform Resource Locator (URL) address information, and if the backend server 12-1 or the backend server 12-2 returns data Resource information corresponding to the URL address to the reverse proxy server 11, it is determined that the first request result is normal, and if the backend server 12-1 or the backend server 12-2 does not successfully return data Resource information corresponding to the URL address to the reverse proxy server 11, it is determined that the first request result is abnormal.
In implementation, the first data resource request is randomly sent by the reverse proxy server 11 to the backend server 12-1 or 12-2 according to the internal parameter setting thereof.
And S22, sending a second data resource request to the connected appointed back-end server through the southbound interface, and obtaining a second request result.
In particular, the designated backend server includes at least a first backend server (i.e., backend server 12-1) and a second backend server (i.e., backend server 12-2).
Specifically, the reverse proxy server 11 sends the second data resource request to the first backend server (the backend server 12-1) through its own southbound interface, and records the obtained request result as the first result in the second request result to check whether the backend server 12-1 can be normally accessed through the southbound interface. The second data resource request may be the same as the data resource requested by the first data resource request, that is, the second data resource request and the first data resource request carry the same data resource identifier, that is: the second data resource request carries the same URL address information as the first data resource request, and the second data resource request may also be different from the data resource requested by the first data resource request, that is, the second data resource request and the first data resource request carry different data resource identifiers, that is: the second data resource request and the first data resource request carry different URL address information, which is not limited in the embodiment of the present invention. If the back-end server 12-1 returns the data resource information corresponding to the URL address in the second data resource request to the reverse proxy server 11, it is determined that the first result in the second request result is normal, and if the back-end server 12-1 does not return the data resource information corresponding to the URL address in the second data resource request to the reverse proxy server 11, it is determined that the first result in the second request result is abnormal.
Meanwhile, the reverse proxy server 11 sends the second data resource request to a second backend server (backend server 12-2) through its own southbound interface, and records the obtained request result as a second result in the second request result to check whether the backend server 12-2 can be normally accessed through the southbound interface. If the back-end server 12-2 returns the data resource information corresponding to the URL address in the second data resource request to the reverse proxy server 11, it is determined that the second result in the second request result is normal, and if the back-end server 12-2 does not return the data resource information corresponding to the URL address in the second data resource request to the reverse proxy server 11, it is determined that the second result in the second request result is abnormal.
S23, receiving a third data resource request sent by the client, sending the third data resource request to the target back-end server, and obtaining a third request result.
In specific implementation, the client 10 sends a third data resource request to the reverse proxy server 11 through the northbound interface of the reverse proxy server 11, and the reverse proxy server 11 receives the third data resource request sent by the client through the northbound interface of the reverse proxy server and sends the third data resource request to the target backend server, so as to obtain a third request result, so as to detect whether the client 10 can normally access the target backend server through the reverse proxy server 11. The third data resource request may be the same as or different from the data resources requested by the first data resource request and the second data resource request, and is not described herein again. The target backend server is any one of the first backend server and the second backend server, namely: the target backend server is any one of the first backend server (backend server 12-1) and the second backend server (backend server 12-2), and in the implementation process, the third data resource request is randomly sent to the backend server 12-1 or the backend server 12-2 by the reverse proxy server 11 according to the internal parameter setting thereof. And if the client 10 receives the data resource requested by the client 10 returned by the reverse proxy server 11, determining that the third request result is normal, wherein the data resource received by the client 10 is the data resource requested by the client 10 returned by the back-end server 12-1 or the back-end server 12-2 to the reverse proxy server 11 and is sent to the client 10 by the reverse proxy server 11, and if the client 10 does not receive the data resource requested by the client 10 returned by the reverse proxy server 11, determining that the third request result is abnormal.
S24, determining a reverse proxy test result according to the first request result, the second request result and the third request result.
In specific implementation, the reverse proxy server 10 may determine the reverse proxy test result according to the first request result, the first result in the second request result, the second result in the second request result, and the third request result, and may include at least the following four cases:
in the first case:
and when the first request result is determined to be normal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is normal, determining that the communication of the reverse proxy server is normal.
In specific implementation, if the reverse proxy server 11 can normally access the back-end server 12-1 or the back-end server 12-2 through its northbound interface (i.e. when the reverse proxy server 11 sends a first data resource request to the back-end server 12-1 or the back-end server 12-2 through its northbound interface, the back-end server 12-1 or the back-end server 12-2 successfully returns the requested data resource information to the reverse proxy server 11), and the reverse proxy server 11 can normally access the back-end server 12-1 through its southbound interface (i.e. when the reverse proxy server 11 sends a second data request to the back-end server 12-1 through its southbound interface, the back-end server 12-1 successfully returns the requested data resource information to the reverse proxy server 11), and the reverse proxy server 11 can normally access the back-end server 12-2 through its southbound interface (i.e. the reverse proxy server 11) When the proxy server 11 sends the second data request to the backend server 12-2 through its southbound interface, the backend server 12-2 successfully returns the requested data resource information to the reverse proxy server 11), and the client 10 can normally access the backend server 12-1 or the backend server 12-2 through the reverse proxy server 11 (i.e.: the client 10 sends the third data resource request to the reverse proxy server 11 through the northbound interface of the reverse proxy server 11, and after the reverse proxy server 11 sends the third data resource request to the backend server 12-1 or the backend server 12-2, the client 10 successfully receives the data resource requested by the client 10 and returned by the reverse proxy server 11), it determines that the connectivity of the reverse proxy server 11 is normal.
In the second case:
when determining that a first result in the second request results is abnormal, determining that the reverse proxy server is abnormal when accessing the first back-end server; and when a second result in the second request result is abnormal, determining that the reverse proxy server is abnormal when accessing the second back-end server.
In specific implementation, if the reverse proxy server 11 fails to access the backend server 12-1 through its southbound interface (i.e. when the reverse proxy server 11 sends the second data request to the backend server 12-1 through its southbound interface, the backend server 12-1 does not successfully return the requested data resource information to the reverse proxy server 11), it is determined that the access of the reverse proxy server 11 to the backend server 12-1 is abnormal. If the reverse proxy server 11 fails to access the backend server 12-2 through its southbound interface (i.e., the backend server 12-2 does not successfully return the requested data resource information to the reverse proxy server 11 when the reverse proxy server 11 sends the second data request to the backend server 12-2 through its southbound interface), it is determined that the reverse proxy server 11 has an exception to access the backend server 12-2.
In this case, it is described that the access to the backend servers 12-1 and 12-2 through the proxy server 11 is abnormal, but it cannot be described that the reverse proxy server 11 itself is abnormal, and it is necessary to further check whether the path between the proxy server 11 and the backend server 12-1 and the path between the proxy server 11 and the backend server 12-2 are abnormal, and if the path between the proxy server 11 and the backend server 12-1 and the path between the proxy server 11 and the backend server 12-2 are both normal, it is possible to further detect whether the configurations of the backend server 12-1 and the backend server 12-2 are abnormal, so as to accurately locate the abnormal point.
In the third case:
and when determining that a first result in the second request results is normal, a second result in the second request results is normal and the first request result is abnormal, determining that the proxy process of the proxy server is abnormal.
In specific implementation, if the reverse proxy server 11 can normally access the backend server 12-1 through its southbound interface (i.e. when the reverse proxy server 11 sends the second data request to the backend server 12-1 through its southbound interface, the backend server 12-1 successfully returns the requested data resource information to the reverse proxy server 11), and the reverse proxy server 11 can normally access the backend server 12-2 through its southbound interface (i.e. when the reverse proxy server 11 sends the second data request to the backend server 12-2 through its southbound interface, the backend server 12-2 successfully returns the requested data resource information to the reverse proxy server 11), the reverse proxy server 11 fails to access the backend server 12-1 or the backend server 12-2 through its northbound interface (i.e. when the reverse proxy server 11 sends the second data request to the backend server 12-1 through its southbound interface, the reverse proxy server 11 fails to access the backend server 12-1 or the backend server 12-2 through its northbound interface) When the end server 12-2 sends the first data resource request, the back-end server 12-1 or the back-end server 12-2 successfully returns the requested data resource information to the non-reverse proxy server 11), it is determined that the proxy process of the proxy server 11 is abnormal.
In a fourth case:
and when determining that the first request result is abnormal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is abnormal, determining that the configuration of the northbound interface network of the reverse proxy server is abnormal.
In specific implementation, if the reverse proxy server 11 fails to access the back-end server 12-1 or the back-end server 12-2 through its northbound interface (i.e. when the reverse proxy server 11 sends a first data resource request to the back-end server 12-1 or the back-end server 12-2 through its northbound interface, the back-end server 12-1 or the back-end server 12-2 successfully returns the requested data resource information to the non-reverse proxy server 11), the reverse proxy server 11 can normally access the back-end server 12-1 through its southbound interface (i.e. when the reverse proxy server 11 sends a second data request to the back-end server 12-1 through its southbound interface, the back-end server 12-1 successfully returns the requested data resource information to the reverse proxy server 11), and the reverse proxy server 11 can normally access the back-end server 12-2 through its southbound interface (i.e. the reverse proxy server 11) When the server 11 sends the second data request to the backend server 12-2 through its southbound interface, the backend server 12-2 successfully returns the requested data resource information to the reverse proxy server 11), and the client 10 fails to access the backend server 12-1 or the backend server 12-2 through the reverse proxy server 11 (i.e.: client 10 sends a third data resource request to reverse proxy server 11 through the northbound interface of reverse proxy server 11, and client 10 does not successfully receive the data resource requested by client 10 returned by reverse proxy server 11), it is determined that the northbound interface network configuration of reverse proxy server 11 is abnormal.
In the reverse proxy testing method provided by the embodiment of the invention, a reverse proxy server sends a first data resource request to a target back-end server connected through a north interface to obtain a first request result, the reverse proxy server sends a second data resource request to a designated back-end server connected through a south interface to obtain a second request result, the reverse proxy server receives a third data resource request sent by a client and sends the third data resource request to the target back-end server to obtain a third request result, and further determines a reverse proxy testing result according to the first request result, the second request result and the third request result, the connectivity of the reverse proxy server is detected according to the three access modes, and the connectivity of the reverse proxy server is judged by synthesizing the request results of the data resources corresponding to the three access modes, so that when the connectivity of the reverse proxy server is abnormal, the abnormal reason can be positioned more quickly and accurately, invalid investigation caused by wrong positioning is avoided, the accuracy of the reverse proxy connectivity test is improved, and the test efficiency is improved.
Based on the same inventive concept, the embodiment of the invention also provides a reverse proxy testing device, and as the principle of solving the problems of the reverse proxy testing device is similar to the reverse proxy testing method, the implementation of the device can be referred to the implementation of the method, and repeated details are not repeated.
As shown in fig. 3, which is a schematic structural diagram of a reverse proxy test apparatus 300 according to an embodiment of the present invention, the reverse proxy test apparatus may include:
the first testing unit 31 is configured to send a first data resource request to a target backend server connected through a northbound interface, and obtain a first request result;
the second testing unit 32 is configured to send a second data resource request to the connected specified backend server through the southbound interface, so as to obtain a second request result;
the third testing unit 33 is configured to receive a third data resource request sent by a client, send the third data resource request to the target backend server, and obtain a third request result;
a determining unit 34, configured to determine a reverse proxy test result according to the first request result, the second request result, and the third request result.
In a possible implementation manner, the designated backend server includes at least a first backend server and a second backend server, and the target backend server is any one of the first backend server and the second backend server.
In a possible implementation manner, the second testing unit 32 is specifically configured to send the second data resource request to the first backend server through a southbound interface, and obtain a first result in second request results; and sending the second data resource request to the second back-end server through a southbound interface to obtain a second result in the second request result.
In a possible implementation manner, the determining unit 34 is specifically configured to determine that the reverse proxy server is normally connected when it is determined that the first request result is normal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is normal; when determining that a first result in the second request results is abnormal, determining that the reverse proxy server is abnormal when accessing the first back-end server; when a second result in the second request result is abnormal, determining that the reverse proxy server is abnormal when accessing the second back-end server; when determining that a first result in the second request results is normal, a second result in the second request results is normal, and the first request result is abnormal, determining that the proxy process of the proxy server is abnormal; and when the first request result is determined to be abnormal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is determined to be abnormal, determining that the configuration of the northbound interface network of the reverse proxy server is abnormal.
In a possible implementation, the third testing unit 33 is specifically configured to receive, by the reverse proxy server, a third data resource request sent by the client through the northbound interface.
Based on the same technical concept, an embodiment of the present invention further provides an electronic device 400, and referring to fig. 4, the electronic device 400 is configured to implement the reverse proxy test method described in the foregoing method embodiment, where the electronic device 400 of this embodiment may include: a memory 401, a processor 402, and a computer program, such as a reverse proxy test program, stored in the memory and executable on the processor. The processor, when executing the computer program, implements the steps in each of the above embodiments of the reverse proxy testing method, such as step S21 shown in fig. 2. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units in the above-described device embodiments, for example, 31.
The embodiment of the present invention does not limit the specific connection medium between the memory 401 and the processor 402. In the embodiment of the present application, the memory 401 and the processor 402 are connected by the bus 403 in fig. 4, the bus 403 is represented by a thick line in fig. 4, and the connection manner between other components is merely illustrative and is not limited thereto. The bus 403 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The memory 401 may be a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 401 may also be a non-volatile memory (non-volatile memory) such as, but not limited to, a read-only memory (rom), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD), or the memory 401 may be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 401 may be a combination of the above memories.
Processor 402, configured to implement a reverse proxy testing method as shown in fig. 2, includes:
the processor 402 is configured to invoke the computer program stored in the memory 401 to execute step S21 shown in fig. 2, where the reverse proxy server sends a first data resource request to a target backend server connected via a northbound interface to obtain a first request result, step S22 sends a second data resource request to a designated backend server connected via a southbound interface to obtain a second request result, step S23 receives a third data resource request sent by a client, sends the third data resource request to the target backend server to obtain a third request result, and step S24 determines a reverse proxy test result according to the first request result, the second request result, and the third request result.
The embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions required to be executed by the processor, and includes a program required to be executed by the processor.
In some possible embodiments, the various aspects of the reverse proxy testing method provided by the present invention may also be implemented in the form of a program product, which includes program code for causing an electronic device to execute the steps in the reverse proxy testing method according to various exemplary embodiments of the present invention described above in this specification when the program product is run on the electronic device, for example, the electronic device may execute step S21 shown in fig. 2, where the reverse proxy server sends a first data resource request to a target backend server connected through a northbound interface, obtains a first request result, step S22 sends a second data resource request to a specified backend server connected through a southbound interface, obtains a second request result, step S23 receives a third data resource request sent by a client, sends the third data resource request to the target backend server, obtaining a third request result, and step S24, determining a reverse proxy test result according to the first request result, the second request result and the third request result.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A reverse proxy testing method, comprising:
the reverse proxy server sends a first data resource request to a connected target back-end server through a northbound interface to obtain a first request result;
sending a second data resource request to a connected appointed back-end server through a southbound interface to obtain a second request result;
receiving a third data resource request sent by a client, sending the third data resource request to the target back-end server, and obtaining a third request result;
and determining a reverse proxy test result according to the first request result, the second request result and the third request result.
2. The method of claim 1, wherein the designated backend server comprises at least a first backend server and a second backend server, the target backend server being any one of the first backend server and the second backend server.
3. The method of claim 2, wherein sending a second data resource request to the connected specified backend server through the southbound interface to obtain a second request result, specifically comprising:
sending the second data resource request to the first back-end server through a southbound interface to obtain a first result in second request results;
and sending the second data resource request to the second back-end server through a southbound interface to obtain a second result in the second request result.
4. The method of claim 3, wherein determining a reverse proxy test result based on the first request result, the second request result, and the third request result comprises:
when the first request result is determined to be normal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is normal, determining that the communication of the reverse proxy server is normal;
when determining that a first result in the second request results is abnormal, determining that the reverse proxy server is abnormal when accessing the first back-end server; when a second result in the second request result is abnormal, determining that the reverse proxy server is abnormal when accessing the second back-end server;
when determining that a first result in the second request results is normal, a second result in the second request results is normal, and the first request result is abnormal, determining that the proxy process of the proxy server is abnormal;
and when the first request result is determined to be abnormal, the first result in the second request result is normal, the second result in the second request result is normal, and the third request result is determined to be abnormal, determining that the configuration of the northbound interface network of the reverse proxy server is abnormal.
5. The method of claim 1, wherein receiving the third data resource request sent by the client specifically comprises:
and the reverse proxy server receives a third data resource request sent by the client through the northbound interface.
6. A reverse proxy test apparatus, comprising:
the first test unit is used for sending a first data resource request to a connected target back-end server through a northbound interface to obtain a first request result;
the second test unit is used for sending a second data resource request to the connected appointed back-end server through the southbound interface to obtain a second request result;
the third test unit is used for receiving a third data resource request sent by a client, sending the third data resource request to the target back-end server and obtaining a third request result;
and the determining unit is used for determining a reverse proxy test result according to the first request result, the second request result and the third request result.
7. The apparatus of claim 6, wherein the designated backend server comprises at least a first backend server and a second backend server, the target backend server being any one of the first backend server and the second backend server.
8. The apparatus of claim 7,
the second testing unit is specifically configured to send the second data resource request to the first back-end server through a southbound interface, and obtain a first result in second request results; and sending the second data resource request to the second back-end server through a southbound interface to obtain a second result in the second request result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the reverse proxy testing method according to any one of claims 1 to 5 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the reverse proxy testing method according to any one of claims 1 to 5.
CN202110929893.8A 2021-08-13 2021-08-13 Reverse proxy test method, device, electronic equipment and storage medium Active CN113708992B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110929893.8A CN113708992B (en) 2021-08-13 2021-08-13 Reverse proxy test method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110929893.8A CN113708992B (en) 2021-08-13 2021-08-13 Reverse proxy test method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113708992A true CN113708992A (en) 2021-11-26
CN113708992B CN113708992B (en) 2022-08-12

Family

ID=78652847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110929893.8A Active CN113708992B (en) 2021-08-13 2021-08-13 Reverse proxy test method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113708992B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080275980A1 (en) * 2007-05-04 2008-11-06 Hansen Eric J Method and system for testing variations of website content
CN104009880A (en) * 2013-02-27 2014-08-27 阿里巴巴集团控股有限公司 Web test method, proxy server and Web test device
US9203931B1 (en) * 2013-04-01 2015-12-01 Amazon Technologies, Inc. Proxy server testing
CN107682442A (en) * 2017-10-18 2018-02-09 中国银联股份有限公司 A kind of Web connection methods and device
CN108900598A (en) * 2018-06-26 2018-11-27 杭州朗和科技有限公司 Network request forwarding and response method, device, system, medium and electronic equipment
CN109379253A (en) * 2018-11-02 2019-02-22 建湖云飞数据科技有限公司 Reverse Proxy method for monitoring abnormality
US10999413B1 (en) * 2020-05-21 2021-05-04 R Software Inc. Public and private API hub synchronization

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080275980A1 (en) * 2007-05-04 2008-11-06 Hansen Eric J Method and system for testing variations of website content
CN104009880A (en) * 2013-02-27 2014-08-27 阿里巴巴集团控股有限公司 Web test method, proxy server and Web test device
US9203931B1 (en) * 2013-04-01 2015-12-01 Amazon Technologies, Inc. Proxy server testing
CN107682442A (en) * 2017-10-18 2018-02-09 中国银联股份有限公司 A kind of Web connection methods and device
CN108900598A (en) * 2018-06-26 2018-11-27 杭州朗和科技有限公司 Network request forwarding and response method, device, system, medium and electronic equipment
CN109379253A (en) * 2018-11-02 2019-02-22 建湖云飞数据科技有限公司 Reverse Proxy method for monitoring abnormality
US10999413B1 (en) * 2020-05-21 2021-05-04 R Software Inc. Public and private API hub synchronization

Also Published As

Publication number Publication date
CN113708992B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN109067930B (en) Domain name access method, domain name resolution method, server, terminal and storage medium
US8719818B2 (en) Cloud-based test system utilizing cloud systems that include cloud servers to simulate virtual test machines to test an electrical device
CN108924005B (en) Network detection method, network detection apparatus, medium, and device
US20200327045A1 (en) Test System and Test Method
CN109299015B (en) Software testing method, device and system
US11196728B1 (en) Caching login sessions to access a software testing environment
US11444785B2 (en) Establishment of trusted communication with container-based services
CN111651329B (en) Health check method and device for application, computer system and storage medium
CN110580305A (en) Method, apparatus, system, and medium for generating identifier
US20200382382A1 (en) Method and system for detecting service quality of cdn system
CN108541000B (en) Method, medium and device for detecting network connection
KR20200048633A (en) System and method for automatically testing software
CN113708992B (en) Reverse proxy test method, device, electronic equipment and storage medium
CN108647139B (en) System test method, device, storage medium and electronic device
CN107483294B (en) Method and device for monitoring network request
CN113296911B (en) Cluster calling method, cluster calling device, electronic equipment and readable storage medium
US11729246B2 (en) Apparatus and method for determining types of uniform resource locator
CN114584545A (en) Data management method, device, system, storage medium and electronic equipment
CN104869182A (en) Domain name resolution method and device
CN107566211B (en) Method, device and system for accessing test equipment
CN111181864A (en) Method and apparatus for determining link congestion status from an application to a server
CN112702735A (en) Registration information service method, equipment and computer readable storage medium
CN113315849B (en) Data processing method, device, equipment and storage medium
CN116980396A (en) Code issuing method and device, electronic equipment and storage medium
CN117591393A (en) Process test method and device based on http request

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant