CN114039883B - Proxy testing method and device, electronic equipment and storage medium - Google Patents

Proxy testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114039883B
CN114039883B CN202111341475.3A CN202111341475A CN114039883B CN 114039883 B CN114039883 B CN 114039883B CN 202111341475 A CN202111341475 A CN 202111341475A CN 114039883 B CN114039883 B CN 114039883B
Authority
CN
China
Prior art keywords
proxy
connection information
agent
test
server
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.)
Active
Application number
CN202111341475.3A
Other languages
Chinese (zh)
Other versions
CN114039883A (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.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software 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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111341475.3A priority Critical patent/CN114039883B/en
Publication of CN114039883A publication Critical patent/CN114039883A/en
Application granted granted Critical
Publication of CN114039883B publication Critical patent/CN114039883B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

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 embodiment of the application provides a proxy testing method, a proxy testing device, electronic equipment and a storage medium, and relates to the technical field of network communication. The agent testing method comprises the following steps: initiating test flow, wherein the test flow is used for communication among a client, a proxy and a server; acquiring connection information established at an agent end; acquiring a communication result between the client and the server; and generating a test result of the proxy end according to the connection information and the communication result. The agent testing method is suitable for various agent products, and can achieve the technical effect of improving the applicability and accuracy of agent testing.

Description

Proxy testing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of network communications technologies, and in particular, to a method and apparatus for testing an agent, an electronic device, and a storage medium.
Background
In the prior art, the proxy is a widely applied technology, and has the types of forward proxy, reverse proxy, transparent proxy and the like. The proxy technology can break through the access limit of the client, protect the server, provide better service for the user, and is a bottom technology for realizing the content security detection and processing of the application protocol layer. Therefore, testing of agents is also important. However, the existing proxy test method has poor applicability and cannot be simultaneously applied to various proxy products, such as forwarding proxy products, security proxy products and the like; in addition, the judging method of the comparison result has the possibility of misjudgment, for example, the DNAT (Destination Network Address Translation, destination address conversion) strategy can achieve the same communication effect as the reverse proxy strategy under the specific condition, thereby causing misjudgment and affecting the accuracy of the proxy test.
Disclosure of Invention
The embodiment of the application aims to provide a proxy testing method, a proxy testing device, electronic equipment and a storage medium, which are suitable for various proxy products and can realize the technical effect of improving the applicability and accuracy of proxy testing.
In a first aspect, an embodiment of the present application provides a method for testing an agent, including:
initiating test flow, wherein the test flow is used for communication among a client, a proxy and a server;
acquiring connection information established at the proxy end;
acquiring a communication result between the client and the server;
and generating a test result of the proxy end according to the connection information and the communication result.
In the implementation process, the method for testing the proxy can obtain the connection information established by the proxy end, and the related characteristics of target connection on the proxy equipment are set and checked from the connection angle, and whether the proxy function is normal or not is judged by combining with the actual communication result, so as to generate a test result; the agent testing method is simultaneously suitable for forwarding agent products and security agent products, is also suitable for forward agents, reverse agents, transparent agents and other agent types, can avoid the phenomenon that communication is misjudged to be normal in agent work without agent processing, and can realize the technical effect of improving the applicability and accuracy of agent testing.
Further, the connection information includes first connection information established between the client and the proxy and second connection information established between the proxy and the server, and before the step of obtaining the connection information established at the proxy, the method further includes:
setting a first matching agent mark between the client and the agent, and adding the first matching agent mark to the first connection information;
setting a second matching agent mark between the agent end and the server end, and adding the second matching agent mark to the second connection information.
In the implementation process, the information is marked in the corresponding connection by setting the first matching agent mark and the second matching agent mark, so that the relevant characteristics of the target connection (client and server) on the agent end are set, the relevant characteristics are checked, whether the agent function is normal is judged, and the possibility of misjudgment under special conditions can be effectively avoided.
Further, the field information of the first matching proxy tag includes a first se_proxy, a first proxy_out, and a first inverse proxy_out, and the step of setting the first matching proxy tag between the client and the proxy includes:
setting the field value of the first se_proxy to be 1, setting the field value of the first proxy_out to be 1 in the message connection direction sent to the client by the proxy, and setting the field value of the first reverse proxy_out to be 0 in the message connection direction sent to the proxy by the client.
Further, the field information of the second matching proxy tag includes a second se_proxy, a second proxy_out, and a second inverse proxy_out, and the step of setting the second matching proxy tag between the proxy and the server includes:
setting the field value of the second se_proxy to be 1, setting the field value of the second proxy_out to be 1 in the message connection direction sent to the server by the proxy, and setting the field value of the second inverse proxy_out to be 0 in the message connection direction sent to the proxy by the server.
Further, the step of generating the test result of the proxy end according to the connection information and the communication result includes:
judging whether the connection information is correct or not;
if the connection information is wrong, the proxy function of the proxy end is abnormal, and the test result which is not passed by the test is generated;
if the connection information is correct, judging whether the communication result meets a preset condition;
if the communication result does not meet the preset condition, the proxy function of the proxy end is abnormal, and the test result which is not passed by the test is generated;
if the communication result meets the preset condition, the proxy function of the proxy end is normal, and the test result passing the test is generated.
In the implementation process, the test result is comprehensively judged and output from multiple aspects according to whether the communication result accords with the expectation or not and whether the connection information is correct or not.
Further, the step of initiating the test flow includes:
communication is initiated to generate an instant traffic or a playback history traffic.
In the implementation process, the test flow can be an instant flow or a historical flow, namely, the test flow can be an application protocol flow (instant flow) directly interacted by a client side and a server side, and is closer to a real online environment, and the test result is more accurate and convincing; while the test traffic may also be orderly playback data (historical traffic), providing a variety of options.
In a second aspect, an embodiment of the present application provides a testing apparatus for an agent, including:
the system comprises a test flow initiating module, a test flow receiving module and a test flow sending module, wherein the test flow initiating module is used for initiating test flow, and the test flow is used for communication among a client, a proxy and a server;
the connection information module is used for acquiring connection information established at the proxy end;
the communication result acquisition module is used for acquiring a communication result between the client and the server;
and the generating module is used for generating the test result of the proxy end according to the connection information and the communication result.
Further, the connection information includes first connection information established between the client and the proxy and second connection information established between the proxy and the server, and the apparatus further includes:
the first matching agent module is used for setting a first matching agent mark between the client and the agent end and adding the first matching agent mark to the first connection information;
and the second matching agent module is used for setting a second matching agent mark between the agent end and the server end and adding the second matching agent mark to the second connection information.
Further, the field information of the first matching proxy tag includes a first se_proxy, a first proxy_out and a first inverse proxy_out, where the first matching proxy module is specifically configured to set a field value of the first se_proxy to be 1, a field value of the first proxy_out is set to be 1 in a message connection direction sent to the client by the proxy, and a field value of the first inverse proxy_out is set to be 0 in a message connection direction sent to the proxy by the client.
Further, the field information of the second matching proxy tag includes a second se_proxy, a second proxy_out and a second inverse proxy_out, where the first matching proxy module is specifically configured to set a field value of the second se_proxy to 1, a field value of the second proxy_out is set to 1 in a message connection direction sent by the proxy to the server, and a field value of the second inverse proxy_out is set to 0 in a message connection direction sent by the server to the proxy.
Further, the generating module includes:
a connection information judging unit for judging whether the connection information is correct;
if the connection information is wrong, the proxy function of the proxy end is abnormal, and the test result which is not passed by the test is generated;
the communication result judging unit is used for judging whether the communication result accords with a preset condition or not if the connection information is correct;
if the communication result does not meet the preset condition, the proxy function of the proxy end is abnormal, and the test result which is not passed by the test is generated;
if the communication result meets the preset condition, the proxy function of the proxy end is normal, and the test result passing the test is generated.
Further, the test flow initiation module includes:
and the initiating unit is used for initiating communication and generating instant traffic or playback history traffic.
In a third aspect, an electronic device provided in an embodiment of the present application includes: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspects when the computer program is executed.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored, which when executed on a computer, cause the computer to perform the method according to any one of the first aspects.
In a fifth aspect, embodiments of the present application provide a computer program product, which when run on a computer causes the computer to perform the method according to any of the first aspects.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a testing method of an agent according to an embodiment of the present application;
FIG. 2 is a flow chart of another agent testing method according to an embodiment of the present application;
FIG. 3 is a block diagram of a testing device for an agent according to an embodiment of the present application;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
The embodiment of the application provides a method and a device for testing an agent, electronic equipment and a storage medium, which can be applied to the testing process of the agent function; the method for testing the proxy can obtain the connection information established by the proxy end, set and check the related characteristics of target connection on proxy equipment from the connection angle, judge whether the proxy function is normal or not by combining with the actual communication result, and generate a test result; the agent testing method is simultaneously suitable for forwarding agent products and security agent products, is also suitable for forward agents, reverse agents, transparent agents and other agent types, can avoid the phenomenon that communication is misjudged to be normal in agent work without agent processing, and can realize the technical effect of improving the applicability and accuracy of agent testing.
Referring to fig. 1, fig. 1 is a flow chart of a testing method of an agent according to an embodiment of the present application, where the testing method of an agent includes the following steps:
s100: and initiating test traffic, wherein the test traffic is used for communication among the client, the proxy and the server.
The test traffic may be, for example, real traffic (i.e., real traffic) between the client and the server, or historical traffic between the client and the server, which is not limited herein.
S200: and acquiring connection information established at the proxy end.
Illustratively, after the test traffic is processed by the proxy, the connection information established at the proxy includes connection information between the client and the proxy, and connection information between the proxy and the server; in a specific embodiment, the connection information established at the proxy end can be obtained by running the corresponding test script.
Illustratively, the representative environment of the agent is specifically shown below:
Client——DUT(Proxy System)——Server;
wherein Client is Client, DUT (Proxy System) is proxy, server is Server;
the specific processing steps of the proxy end are as follows:
the method comprises the steps that firstly, a client side and an agent side communicate, the client side sends an agent service request, and after receiving information and matching an agent policy, the agent side sets a mark representing a matching agent module on the basis of connection information taking quintuple (source ip, source port, destination ip, destination port and protocol) as a basic element;
and secondly, the proxy terminal forwards the proxy service request to the server terminal through communication between the proxy terminal and the server terminal, and the connection information of the side is also provided with a mark for representing the matched proxy module.
S300: and obtaining a communication result between the client and the server.
Illustratively, the communication result indicates whether the communication between the client and the server is successful, and whether the communication quality is good.
S400: and generating a test result of the proxy end according to the connection information and the communication result.
By verifying whether the connection information is correct and whether the communication result meets the expectations, it is possible to determine whether the proxy function of the proxy is normal, that is, to generate a test result of the proxy according to the connection information and the communication result.
In some implementation scenarios, the method for testing the proxy can obtain connection information established by the proxy end, and through setting and checking relevant characteristics of target connection on proxy equipment from the connection angle, judge whether the proxy function is normal or not by combining with an actual communication result, and generate a test result; the agent testing method is simultaneously suitable for forwarding agent products and security agent products, is also suitable for forward agents, reverse agents, transparent agents and other agent types, can avoid the phenomenon that communication is misjudged to be normal in agent work without agent processing, and can realize the technical effect of improving the applicability and accuracy of agent testing.
Referring to fig. 2, fig. 2 is a schematic diagram of another agent testing method according to an embodiment of the present application.
Illustratively, the connection information includes first connection information established between the client and the proxy and second connection information established between the proxy and the server, in S200: before the step of obtaining the connection information established at the proxy end, the testing method of the proxy further comprises the following steps:
s201: setting a first matching agent mark between the client and the agent, and adding the first matching agent mark to the first connection information;
s202: setting a second matching agent flag between the agent side and the server side, and adding the second matching agent flag to the second connection information.
By setting a first matching agent mark and a second matching agent mark, the fact that communication is processed by the agent end is subjected to information marking in the corresponding connection, so that the relevant characteristics of target connection (client end and server end) on the agent end are set, and further the relevant characteristics are checked to assist and judge whether the agent function is normal, and the possibility of misjudgment under special conditions can be effectively avoided; for example, in some cases, the DNAT policy may achieve the same communication effect as the reverse proxy policy, so that the client and the server may connect normally through the DNAT policy and complete communication, and not pass through the proxy, where the test result may not reflect whether the proxy function is normal, resulting in misjudgment that the proxy function of the proxy is normal.
Illustratively, S201: the field information of the first matching agent flag includes a first se_proxy, a first proxy_out, and a first inverse proxy_out, and the step of setting the first matching agent flag between the client and the agent includes:
the field value of the first se_proxy is set to be 1, the field value of the first proxy_out is set to be 1 in the message connection direction of the proxy sent to the client, and the field value of the first reverse proxy_out is set to be 0 in the message connection direction of the client sent to the proxy.
In some embodiments, a specific position 1 representing a first se_proxy in a binary bit string with a specific length in the first matching proxy tag sets a first proxy_out field value to 1 and a first inverse proxy_out field value to 0 in a message connection direction of a proxy returning to the client.
Illustratively, S202: the field information of the second matching proxy tag includes a second se_proxy, a second proxy_out, and a second inverse proxy_out, and the step of setting the second matching proxy tag between the proxy and the server includes:
setting the field value of the second se_proxy to be 1, setting the field value of the second proxy_out to be 1 in the message connection direction of the proxy sent to the server, and setting the field value of the second inverse proxy_out to be 0 in the message connection direction of the server sent to the proxy.
In some embodiments, a specific position 1 representing a second se_proxy in a binary bit string with a specific length in the second matching proxy tag sets a second proxy_out field value to 1 and a second inverse proxy_out field value to 0 in a message direction sent from the proxy to the server.
Illustratively, the first and second se_proxy may be collectively referred to as a se_proxy tag; the first proxy_out, the first inverse proxy_out, the second proxy_out, and the second inverse proxy_out may be collectively referred to as a proxy_out field.
Illustratively, S400: generating a test result of the proxy end according to the connection information and the communication result, including:
s410: judging whether the connection information is correct or not;
s420: if the connection information is wrong, the proxy function of the proxy end is abnormal, and a test result which does not pass the test is generated;
s430: if the connection information is correct, judging whether the communication result meets the preset condition;
if the communication result does not meet the preset condition, jumping to S420;
s440: if the communication result meets the preset condition, the proxy function of the proxy end is normal, and a test result passing the test is generated.
The test result is comprehensively judged and output from multiple aspects, namely whether the communication result meets the expectations or not and whether the connection information is correct or not.
Illustratively, S100: a step of initiating a test flow, comprising:
s110: communication is initiated to generate an instant traffic or a playback history traffic.
The test flow can be application protocol flow (instant flow) directly interacted by the client and the server, and is closer to the real online environment, and the test result is more accurate and convincing; while the test traffic may also be orderly playback data (historical traffic), providing a variety of options.
For example, the prior patent document CN103795762 a-a reverse proxy testing method and system describes a testing method and system for testing a reverse proxy server, and the technical scheme mainly comprises the following steps: firstly, a field construction request message is required to be extracted from an access log, the contents of an http request and an http response are recorded and a corresponding relation is established when no agent participates, secondly, the http response contents forwarded by a proxy server are obtained through playback of the http request and the http response, and thirdly, the proxy server is judged to work normally if the contents in the first step are the same as the contents in the second step, and the proxy server is judged to work abnormally if the contents in the first step are different. However, this solution has the following drawbacks: the request flow is artificially constructed, and the request flow is sequentially played back according to manually set time delay and other parameters, so that the request flow has large environmental difference from a real online environment, and the agent is insufficiently tested; the judging method of the comparison result is only suitable for forwarding agent products and is not suitable for security agent products; the judgment method of the comparison result has the possibility of misjudgment. For example, the DNAT policy may achieve the same communication effect as the reverse proxy policy under certain conditions.
In some embodiments, a specific flow example of a testing method for an agent provided by the embodiment of the present application is as follows:
1) And running the test script. The test flow between the client and the server is the real flow.
2) And obtaining connection information established by the test flow on the proxy end from the test script.
3) Checking whether the five-tuple information of the first connection information and the second connection information is correct.
4) Checking whether the marking information of the first se_proxy and the second se_proxy is correct.
5) Checking whether the field information of the first proxy_out, the first inverse proxy_out, the second proxy_out, and the second inverse proxy_out is correct.
6) Judging whether the agent works normally or not according to the results of the steps 3), 4) and 5) and combining with the actual communication results; there are the following concentrated cases:
6.1 The five-tuple information, the se_proxy mark and the proxy_out field are connected correctly, the communication result accords with the expectation, and the proxy functions normally and the test passes.
6.2 The five-tuple information, the se_proxy mark and the proxy_out field of the connection are correct, and if the communication result does not accord with the expectation, the test is not passed.
6.3 The five-tuple information of the connection is correct, the se_proxy mark and the proxy_out field are wrong, and whether the communication result accords with the expectation or not, the proxy function is abnormal and the test is not passed.
6.4 The five-tuple information of the connection is incorrect, whether the se_proxy flag, the proxy_out field and the communication result are correct or not, the test is not passed.
In some implementation scenarios, taking the test of the http reverse proxy function as an example, the specific implementation steps of the proxy testing method provided by the embodiment of the application are as follows:
(1) and running the script. The client uses the wget tool, and the server provides http service with Nginx.
(2) After receiving syn (Synchronize Sequence Numbers, synchronization sequence number) initiated by the client, the proxy establishes tcp connection according to five-tuple information, and the destination ip and destination port of the syn message meet the conditions set in the http reverse proxy policy, namely, the proxy module is matched. The proxy marks the connected se_proxy with the position 1, sets the proxy_out field value to 1 in the downlink direction of the connection, and sets the proxy_out field value to 0 in the uplink direction. The proxy end completes TCP handshake with the client end.
(3) The proxy end initiates TCP handshake to the server end to establish connection. The proxy marks the connected se_proxy with the position 1, sets the proxy_out field value to 1 in the uplink direction of the connection, and sets the proxy_out field value to 0 in the downlink direction. The proxy end and the server end complete TCP handshake.
(4) And simultaneously, the Client initiates an http request to the DUT proxy module.
(5) The DUT agent module initiates an http request to the Server, and returns to the Client after receiving the http response.
(6) The test script obtains the information of the two target connections corresponding to the communication. The five-tuple information, the se_proxy tag, and the proxy_out field information are checked.
(7) And (3) processing http subsequent application layer data referring to the step 4) and the step 5), until the http access is finished, and the tcp is normally finished. Test script records, checks the communication process of the wget and results report.
(8) And (3) integrating the checking results of the step (6) and the step (7), and outputting a testing result according to the judging principle of the step (6).
Referring to fig. 3, fig. 3 is a block diagram of a testing device for an agent according to an embodiment of the present application, where the testing device for an agent includes:
the test flow initiating module 100 is used for initiating test flow, wherein the test flow is used for communication among the client, the proxy end and the server end;
a connection information module 200, configured to obtain connection information established at the proxy end;
the communication result obtaining module 300 is configured to obtain a communication result between the client and the server;
and the generating module 400 is configured to generate a test result of the proxy end according to the connection information and the communication result.
Illustratively, the connection information includes first connection information established between the client and the proxy and second connection information established between the proxy and the server, and the testing apparatus of the proxy further includes:
the first matching agent module is used for setting a first matching agent mark between the client and the agent end and adding the first matching agent mark to the first connection information;
and the second matching agent module is used for setting a second matching agent mark between the agent end and the server end and adding the second matching agent mark to the second connection information.
The field information of the first matching proxy tag includes a first se_proxy, a first proxy_out, and a first inverse proxy_out, where the first matching proxy module is specifically configured to set a field value of the first se_proxy to 1, a field value of the first proxy_out is set to 1 in a message connection direction sent to the client by the proxy, and a field value of the first inverse proxy_out is set to 0 in a message connection direction sent to the proxy by the client.
The field information of the second matching proxy tag includes a second se_proxy, a second proxy_out, and a second inverse proxy_out, where the second matching proxy module is specifically configured to set a field value of the second se_proxy to 1, a field value of the second proxy_out is set to 1 in a message connection direction sent to the server by the proxy, and a field value of the second inverse proxy_out is set to 0 in a message connection direction sent to the proxy by the server.
Illustratively, the generating module 400 includes:
a connection information judging unit for judging whether the connection information is correct;
if the connection information is wrong, the proxy function of the proxy end is abnormal, and a test result which does not pass the test is generated;
the communication result judging unit is used for judging whether the communication result accords with the preset condition if the connection information is correct;
if the communication result does not meet the preset condition, the proxy function of the proxy end is abnormal, and a test result which does not pass the test is generated;
if the communication result meets the preset condition, the proxy function of the proxy end is normal, and a test result passing the test is generated.
Illustratively, the test traffic initiating module 100 includes:
and the initiating unit is used for initiating communication and generating instant traffic or playback history traffic.
The application further provides an electronic device, please refer to fig. 4, and fig. 4 is a block diagram of an electronic device according to an embodiment of the application. The electronic device may include a processor 510, a communication interface 520, a memory 530, and at least one communication bus 540. Wherein the communication bus 540 is used to enable direct connection communication for these components. The communication interface 520 of the electronic device in the embodiment of the present application is used for performing signaling or data communication with other node devices. Processor 510 may be an integrated circuit chip with signal processing capabilities.
The processor 510 may be a general-purpose processor, including a central processing unit (CPU, central Processing Unit), a network processor (NP, network Processor), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 510 may be any conventional processor or the like.
The Memory 530 may be, but is not limited to, random access Memory (RAM, random Access Memory), read Only Memory (ROM), programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable Read Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable Read Only Memory (EEPROM, electric Erasable Programmable Read-Only Memory), and the like. The memory 530 has stored therein computer readable instructions which, when executed by the processor 510, may cause an electronic device to perform the various steps described above in relation to the method embodiments of fig. 1-2.
Optionally, the electronic device may further include a storage controller, an input-output unit.
The memory 530, the memory controller, the processor 510, the peripheral interface, and the input/output unit are electrically connected directly or indirectly to each other, so as to realize data transmission or interaction. For example, the elements may be electrically coupled to each other via one or more communication buses 540. The processor 510 is configured to execute executable modules stored in the memory 530, such as software functional modules or computer programs included in the electronic device.
The input-output unit is used for providing the user with the creation task and creating the starting selectable period or the preset execution time for the task so as to realize the interaction between the user and the server. The input/output unit may be, but is not limited to, a mouse, a keyboard, and the like.
It will be appreciated that the configuration shown in fig. 4 is merely illustrative, and that the electronic device may also include more or fewer components than shown in fig. 4, or have a different configuration than shown in fig. 4. The components shown in fig. 4 may be implemented in hardware, software, or a combination thereof.
The embodiment of the application also provides a storage medium, wherein the storage medium stores instructions, and when the instructions run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment, so that repetition is avoided, and no further description is provided here.
The application also provides a computer program product which, when run on a computer, causes the computer to perform the method according to the method embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (8)

1. A method for testing an agent, comprising:
initiating test flow, wherein the test flow is used for communication among a client, a proxy and a server;
acquiring connection information established at an agent end;
acquiring a communication result between the client and the server;
generating a test result of the proxy end according to the connection information and the communication result;
the connection information comprises first connection information established between the client and the proxy and second connection information established between the proxy and the server, and before the step of obtaining the connection information established at the proxy, the method further comprises the steps of:
setting a first matching agent mark between the client and the agent, and adding the first matching agent mark to the first connection information;
setting a second matching agent mark between the agent end and the server end, and adding the second matching agent mark to the second connection information.
2. The method for testing a proxy of claim 1, wherein the field information of the first matching proxy tag includes a first se_proxy, a first proxy_out, and a first inverse proxy_out, and the step of setting the first matching proxy tag between the client and the proxy comprises:
setting the field value of the first se_proxy to be 1, setting the field value of the first proxy_out to be 1 in the message connection direction sent to the client by the proxy, and setting the field value of the first reverse proxy_out to be 0 in the message connection direction sent to the proxy by the client.
3. The method for testing an agent according to claim 1, wherein the field information of the second matching agent flag includes a second se_proxy, a second proxy_out, and a second inverse proxy_out, and the step of setting the second matching agent flag between the agent side and the server side includes:
setting the field value of the second se_proxy to be 1, setting the field value of the second proxy_out to be 1 in the message connection direction sent to the server by the proxy, and setting the field value of the second inverse proxy_out to be 0 in the message connection direction sent to the proxy by the server.
4. The method for testing a proxy according to claim 1, wherein the step of generating the test result of the proxy according to the connection information and the communication result comprises:
judging whether the connection information is correct or not;
if the connection information is wrong, the proxy function of the proxy end is abnormal, and the test result which is not passed by the test is generated;
if the connection information is correct, judging whether the communication result meets a preset condition;
if the communication result does not meet the preset condition, the proxy function of the proxy end is abnormal, and the test result which is not passed by the test is generated;
if the communication result meets the preset condition, the proxy function of the proxy end is normal, and the test result passing the test is generated.
5. The method of proxy testing of claim 1, wherein the step of initiating test traffic comprises:
communication is initiated to generate an instant traffic or a playback history traffic.
6. A proxy testing device, comprising:
the system comprises a test flow initiating module, a test flow receiving module and a test flow sending module, wherein the test flow initiating module is used for initiating test flow, and the test flow is used for communication among a client, a proxy and a server;
the connection information module is used for acquiring connection information established at the proxy end;
the communication result acquisition module is used for acquiring a communication result between the client and the server;
the generation module is used for generating a test result of the proxy end according to the connection information and the communication result;
the connection information comprises first connection information established between the client and the proxy and second connection information established between the proxy and the server, and the device further comprises:
the first matching agent module is used for setting a first matching agent mark between the client and the agent end and adding the first matching agent mark to the first connection information;
and the second matching agent module is used for setting a second matching agent mark between the agent end and the server end and adding the second matching agent mark to the second connection information.
7. An electronic device, comprising: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the agent's test method according to any one of claims 1 to 5 when the computer program is executed.
8. A computer readable storage medium having instructions stored thereon which, when executed by a processor, cause the computer to perform the method of testing an agent according to any of claims 1 to 5.
CN202111341475.3A 2021-11-12 2021-11-12 Proxy testing method and device, electronic equipment and storage medium Active CN114039883B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111341475.3A CN114039883B (en) 2021-11-12 2021-11-12 Proxy testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111341475.3A CN114039883B (en) 2021-11-12 2021-11-12 Proxy testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114039883A CN114039883A (en) 2022-02-11
CN114039883B true CN114039883B (en) 2023-10-10

Family

ID=80137485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111341475.3A Active CN114039883B (en) 2021-11-12 2021-11-12 Proxy testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114039883B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115065723B (en) * 2022-08-17 2022-11-04 中航信移动科技有限公司 Data processing system for network disaster tolerance

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195825A (en) * 2010-03-05 2011-09-21 新奥特(北京)视频技术有限公司 Monitoring system and monitoring method thereof for complete interaction between client and server
CN109120467A (en) * 2017-06-22 2019-01-01 中兴通讯股份有限公司 A kind of Reverse Proxy monitoring method, device and Reverse Proxy
CN113259429A (en) * 2021-05-11 2021-08-13 鸬鹚科技(深圳)有限公司 Session keeping control method, device, computer equipment and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9558097B2 (en) * 2007-11-13 2017-01-31 Red Hat, Inc. Automated recording and playback of application interactions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195825A (en) * 2010-03-05 2011-09-21 新奥特(北京)视频技术有限公司 Monitoring system and monitoring method thereof for complete interaction between client and server
CN109120467A (en) * 2017-06-22 2019-01-01 中兴通讯股份有限公司 A kind of Reverse Proxy monitoring method, device and Reverse Proxy
CN113259429A (en) * 2021-05-11 2021-08-13 鸬鹚科技(深圳)有限公司 Session keeping control method, device, computer equipment and medium

Also Published As

Publication number Publication date
CN114039883A (en) 2022-02-11

Similar Documents

Publication Publication Date Title
CN110414242B (en) Method, device, equipment and medium for detecting business logic loophole
CN107733581B (en) Rapid internet asset feature detection method and device based on whole network environment
CN108255725B (en) Test method and device
CN110266737B (en) Method, device, equipment and medium for detecting vulnerability of cross-domain resource sharing
US20160380867A1 (en) Method and System for Detecting and Identifying Assets on a Computer Network
CN110417747B (en) Method and device for detecting violent cracking behavior
CN109039724B (en) Log uploading method and device
CN107360187B (en) Network hijacking processing method, device and system
CN110830442A (en) Message processing method, device and gateway
CN114039883B (en) Proxy testing method and device, electronic equipment and storage medium
CN110740144B (en) Method, device, equipment and storage medium for determining attack target
KR102011603B1 (en) Packet generating method and apparatus for verifying detection rules
CN112769635B (en) Service identification method and device for multi-granularity feature analysis
CN108075876B (en) Time calibration method, device and system
CN107948022B (en) Identification method and identification device for peer-to-peer network traffic
CN108965108B (en) Message pushing method and related equipment
CN115357513B (en) Program ambiguity test method, device, equipment and storage medium
CN115174245A (en) Test method and system based on DoIP protocol detection
CN111858379A (en) Application testing method and device
CN113242141B (en) Fault detection method and device for user plane network element
CN114679336B (en) Authentication method, authentication system, authentication device, and readable storage medium
CN115426301B (en) Device detection method, device, equipment and storage medium based on self-generated message
KR102387010B1 (en) Monitoring apparatus and monitoring method
CN114297058B (en) Test method and device
CN114143088B (en) Network fault diagnosis method, device, equipment and computer readable storage medium

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