CN103795762B - A kind of test method and system of reverse proxy - Google Patents
A kind of test method and system of reverse proxy Download PDFInfo
- Publication number
- CN103795762B CN103795762B CN201210431552.9A CN201210431552A CN103795762B CN 103795762 B CN103795762 B CN 103795762B CN 201210431552 A CN201210431552 A CN 201210431552A CN 103795762 B CN103795762 B CN 103795762B
- Authority
- CN
- China
- Prior art keywords
- request
- response
- http request
- response information
- processor
- 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
Links
Landscapes
- Computer And Data Communications (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention provides a kind of test methods of reverse proxy, comprising: pre-generated http request is sent to Reverse Proxy by request of loading processor;The http request received is transmitted to response playback processor by the Reverse Proxy, and the response information prerecorded that the response playback processor returns after receiving http request is received, the response information is transmitted to the request of loading processor;The response information received from the Reverse Proxy is compared by the request of loading processor with local preset response information, obtains the test result of the Reverse Proxy according to comparison result;The present invention also provides a kind of test macros of reverse proxy.The technical solution provided according to the present invention can efficiently realize the functional test of Reverse Proxy.
Description
[technical field]
The present invention relates to the measuring technology of internet area more particularly to the test methods and system of a kind of reverse proxy.
[background technique]
Reverse proxy refers to Reverse Proxy the connection request received on internet, then turns the request
The server on internal network is issued, and the result obtained from server is returned to the client for requesting connection on internet
End.Reverse proxy is widely used in major internet, is mainly used for carrying out traffic statistics, flow forwarding and seven layers of attack protection
Deng.
Currently, being needed in the test process of reverse proxy using different clients, such as mobile phone, computer, tablet computer
Deng sending different types of http request to Reverse Proxy, while needing to construct various processing differences in web server
The service of http request, for testing whether Reverse Proxy can work normally.Wherein, a variety of different http requests with
And corresponding service requires tester and constructs manually in web server, therefore when the test process of existing reverse proxy
Between it is longer, it is also difficult to true http request and response environment are simulated, accordingly even when survey all on Reverse Proxy
Example on probation can not guarantee that Reverse Proxy can work normally on line, by examining so as to cause web
Server cannot externally provide normal service.
[summary of the invention]
The present invention provides a kind of test method of reverse proxy and systems, can efficiently realize Reverse Proxy
Functional test.
The specific technical solution of the present invention is as follows:
According to one preferred embodiment of the present invention, a kind of test method of reverse proxy, comprising:
Pre-generated http request is sent to Reverse Proxy by request of loading processor;
The http request received is transmitted to response playback processor by the Reverse Proxy, and receives the response
The response information that playback processor returned after receiving http request prerecord forwards the response information
To the request of loading processor;
The request of loading processor is default by the response information received from the Reverse Proxy and locally
Response information be compared, obtain the test result of the Reverse Proxy according to comparison result.
In the above method, the method for the pre-generated http request of the request of loading processor are as follows:
The Request Log file of web server, the Request Log of the web server is stored in advance in request of loading processor
File includes the Request Log information of web server;
Request of loading processor extracts field from the Request Log information of the web server;
Request of loading processor fills preset http request template using the field extracted, and generates http request.
In the above method, the method for the pre-generated http request of the request of loading processor are as follows:
Request of loading processor receives the http information of user's input;
Request of loading processor fills preset http request template using the http information of user's input, generates http and asks
It asks.
In the above method, method that the response playback processor prerecords response information are as follows:
Response playback processor receives and stores the http request that request of loading processor or browser are sent;
The http request received is transmitted to web server by response playback processor, and is received the web server and returned
The correspondence http request response information;
Response playback processor stores the corresponding relationship of the response information and response information and http request.
In the above method, the method for response information is preset in request of loading processor are as follows:
Request of loading processor receives the response information and response information copied out from response playback processor
With the corresponding relationship of http request.
In the above method, the response playback processor returns to the response letter prerecorded after receiving http request
The method of breath are as follows:
Corresponding relationship of the response playback processor according to preset http request and response information, finds the http
Request corresponding response information;
Response playback processor, will according to the random value in pre-set forward delay interval fixed value or forward delay interval section
The response information found returns to Reverse Proxy.
It is described to obtain the test result of the Reverse Proxy according to comparison result in the above method, specifically:
If the information in two response information is not identical, judging the function of Reverse Proxy, there are different
Often, preset subscriber mailbox is sent by alarm mail;Include: in the alarm mail received from Reverse Proxy it is different
The corresponding http request of response information of normal response information, exception, the local preset http request are corresponding
Response information;
If the information in two response information is identical, judge that the function of Reverse Proxy is normal, it will
Test report is sent to preset subscriber mailbox;When the test report includes: the quantity of the http request of transmission, each response
Between return in the number of the corresponding response information of section, the average value of response time and the response information that receives
Value.
A kind of test macro of reverse proxy, comprising: request of loading processor, Reverse Proxy, at response playback
Manage device;Wherein,
Request of loading processor, for the http request pre-generated to be sent to Reverse Proxy;
Reverse Proxy for the http request received to be transmitted to response playback processor, and is answered described in reception
The response information prerecorded that playback processor returns after receiving http request is answered, the response information is turned
Issue the request of loading processor;
Request of loading processor, the response information for being also used to receive from the Reverse Proxy and local are pre-
If response information be compared, obtain the test result of the Reverse Proxy according to comparison result.
In above system, the request of loading processor pre-generates http request, specifically:
The Request Log file of web server is stored in advance, the Request Log file of the web server takes comprising web
The Request Log information of business device;
Field is extracted from the Request Log information of the web server;
Preset http request template is filled using the field of extraction, generates http request.
In above system, the request of loading processor pre-generates http request, specifically:
Receive the http information of user's input;
Preset http request template is filled using the http information of user's input, generates http request.
In above system, the response playback processor prerecords response information, specifically:
Receive and store the http request that request of loading processor or browser are sent;
The http request received is transmitted to web server, and receives the correspondence http that the web server returns
The response information of request;
Store the corresponding relationship of the response information and response information and http request.
In above system, response information is preset in request of loading processor, specifically:
Request of loading processor receives the response information and response information copied out from response playback processor
With the corresponding relationship of http request.
In above system, the response playback processor returns to the response letter prerecorded after receiving http request
Breath, specifically:
According to the corresponding relationship of preset http request and response information, it is corresponding to find the http request
Response information;
According to the random value in pre-set forward delay interval fixed value or forward delay interval section, the response that will be found
Information returns to Reverse Proxy.
In above system, the request of loading processor obtains the test of the Reverse Proxy according to comparison result
As a result, specifically:
If the information in two response information is not identical, judging the function of Reverse Proxy, there are different
Often, preset subscriber mailbox is sent by alarm mail;Include: in the alarm mail received from Reverse Proxy it is different
The corresponding http request of response information of normal response information, exception, the local preset http request are corresponding
Response information;
If the information in two response information is identical, judge that the function of Reverse Proxy is normal, it will
Test report is sent to preset subscriber mailbox;When the test report includes: the quantity of the http request of transmission, each response
Between return in the number of the corresponding response information of section, the average value of response time and the response information that receives
Value.
As can be seen from the above technical solutions, provided by the invention to have the advantages that
By the closed loop automatic interaction between request of loading processor, Reverse Proxy and response playback processor,
The functional test for realizing Reverse Proxy does not need to build complicated web services and response environment on a web server,
To substantially reduce the time of test, the testing efficiency of reverse proxy is improved.
[Detailed description of the invention]
Fig. 1 is the structural schematic diagram of the preferred embodiment for the test macro that the present invention realizes reverse proxy;
Fig. 2 is the flow diagram of the preferred embodiment for the test method that the present invention realizes reverse proxy;
Fig. 3 is the flow diagram that response playback processor of the present invention records response information approach;
Networking schematic diagram when Fig. 4 is present invention test Reverse Proxy.
[specific embodiment]
The basic idea of the invention is that: pre-generated http request is sent to reverse proxy and taken by request of loading processor
Business device;The http request received is transmitted to response playback processor by the Reverse Proxy, and is received the response and returned
The response information prerecorded that processor returns after receiving http request is put, the response information is transmitted to
The request of loading processor;The response information that the request of loading processor will be received from the Reverse Proxy
It is compared with local preset response information, obtains the test knot of the Reverse Proxy according to comparison result
Fruit.
To make the objectives, technical solutions, and advantages of the present invention clearer, right in the following with reference to the drawings and specific embodiments
The present invention is described in detail.
The present invention provides a kind of test macro of reverse proxy, and Fig. 1 is the test macro that the present invention realizes reverse proxy
The structural schematic diagram of preferred embodiment, as shown in Figure 1, the system includes: request of loading processor 10, response playback processor 11
With Reverse Proxy 12.
Based on above system, the present invention also provides a kind of test method of reverse proxy, Fig. 2 is that the present invention realizes reversed generation
The flow diagram of the preferred embodiment of the test method of reason, as shown in Fig. 2, the preferred embodiment the following steps are included:
Step 201, request of loading processor extracts field from the Request Log information of web server, according to what is extracted
Field and preset http request template generation http request;Or request of loading processor receives the http information of input, foundation
The http information and preset http request template generation http request.
Specifically, more than one request of loading processor is provided with, at each request of loading in this preferred embodiment
Device is managed, user requires that the Request Log file of web server is stored the web server into request of loading processor in advance
Request Log file content be user by browser send http request to web server when, web server foundation
The log that the http request received saves, belongs to true http request log, the Request Log file of the web server on line
In include more than one web server Request Log information, request of loading processor is according to preset strategy from web server
Request Log information in extract multiple fields, as request type, request address, browser being capable of decoded data encoding sides
Formula, cookie data, browser type, origin url, the host in initial URL and port etc.;The preset strategy, which can be, to be mentioned
It takes field cited in quotation marks in character string or extracts the field in character string behind space;Request of loading processor takes from web
After extracting field in the Request Log information of device of being engaged in, according to the pre-set http request template of user, the word that will be extracted
Section is filled into http request template, generates http request;Here, request of loading processor needs the request according to web server
The quantity of the Request Log information of web server, generates the http request of identical quantity in journal file, as each web clothes
The Request Log information of business device is all corresponding to generate a http request.
Alternatively, request of loading processor receives the http information of user's input, which includes: request type, asks
Ask address, browser being capable of decoded data coding mode, cookie data, browser type, origin url, the master in initial URL
Machine and port etc.;Then, the http information that user inputs is filled into the pre-set http of user and asked by request of loading processor
It seeks template, generates http request;Here, request of loading processor supports the http information of user's input, can be very easily
It realizes and constructs various types of http requests, for testing the function of Reverse Proxy.
For example, just like the Request Log information of next web server:
61.236.32.126--[05/Mar/2007:00:00:00+0800]″GET/index.php?tn=btplus_cb
HTTP/1.1″2001467mod_gzip:54pct.″www.host.com″″www.referer.com″BAIDUID=141550
BC0DD29E1F93BFD49836DA40CC″Mozilla/4.0(compatible;MSIE 6.0;Windows NT 5.1;
SV1)″
Wherein, GET is request type, replaces the method field in http request template;/index.php?tn=
Btplus_cb HTTP/1.1 is request address, replaces the url field in http request template;Gzip is that browser can decode
Data coding mode, replace http request template in Accept-Encoding field;BAIDUID=141550BC0DD29
E1F93BFD49836DA40CC is cookie data, replaces the cookie field in http request template;Mozilla/4.0
(compatible;MSIE 6.0;Windows NT 5.1;SV1 is browser type, replaces the User- in http request template
Agent field;Www.host.com is host and port in initial URL, replaces the Host field in http request template;
Www.referer.com is origin url, replaces the Referer field in http request template;In addition, in http request template
Accept field is fixed as text/html, application/xhtml+xml, application/xml;q=0.9,*/*;q=
0.8。
According to the field extracted from the example of the Request Log information of above-mentioned web server, the http request of generation is such as
Under:
″GET//index.php?tn=btplus_cb HTTP/1.1\r\nHost:www.host.com\r\nAccept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-
Encoding:gzip,deflate\r\nReferer:www.referer.com\r\nCookie:BAIDUID=141550BC0
DD29E1F93BFD49836DA40CC;\r\nUser-Agent:Mozilla/4.0(compatible;MSIE6.0;Windows
NT 5.1;SV1)\r\n\r\n″。
For example, request of loading processor can receive the following http information of user's input:
GET/testbfe.php HTTP/1.1Host:db-testing-oped3001.db01.baidu.com:
8901User-Agent:Mozilla/5.0(windows NT 5.1;rv:3.0)Gecko/20100101FireFox/
13.0.1Accept-Encoding:gzip,deflateConnection:keep-aliveCookie:BAIDU=ABEE5057
68E4367875D6382A71939FEB:FG=1;BDUT=tbjh0EB0DD6C71BB689AC4C1C1307CFDB346138b7
d734011;USERID=0cac808c2ebd401391dc4d87;Hm_lvt_t46af353ab5a92ddf70d8368b2529
c10=1342609618035;Hm_lvt_e7617bc79ca305e55d9b5d393123de33=1341297466246;6a05
b31484fdc3f8a9edb6307d81ef7a=706f5996fac620d8aa113313a034898a0881a5d4%3A4%3A%
7Bi%3A0%3Bs%3A5%3A5%3A%22admin%22%3Bi%3A1%3Bs%3A5%3A%22admin%22%3Bi%3A2%3Bi%
3A2592000%3Bi%3A3%3Ba3A0%3A%7B%7D%7D;UUAPTGC=TGT-602800-EOC3dchi70EyurqslcFY
CKJlzaNuPFImGqsprpFoIB6N7RfbEF-vvap
Step 202, response playback processor stores the http request received, and is transmitted to web server, receives
The response information that web server returns;Response playback processor and request of loading processor store the response information
And the corresponding relationship of response information and http request.
Specifically, user presets a switch in response playback processor, the switch is for controlling response playback
The operating mode of processor, which can be realized by the way that the attribute of response playback processor is arranged, for example, by response playback
When the field value of status is set as 1 in the attribute of reason device, the operating mode of response playback processor is recording mode, opens letter
Cease recording function, when setting 0 for the field value of status in the attribute of response playback processor, the work of response playback processor
Operation mode is playback mode, opening imformation playback function.
When the operating mode of response playback processor is arranged to recording mode, need to carry out the record of response information
System, as shown in figure 3, the specific recording process of response information is as follows:
Firstly, response playback processor receives http request, which can be the transmission of request of loading processor
Http request;Wherein it is possible to which IP address and the port of response playback processor, request is arranged in request of loading processor in advance
The http request of generation can be sent to response playback processor according to the IP address and port by loading processing device, can be with
Multiple request of loading processors successively send http request and give response playback processor, can also be same with multiple request of loading processors
When send http request give response playback processor;It is played back alternatively, user can send http request by browser to response
Processor, in this way, the received http request of response playback processor is the http request that browser is sent.
Then, on the one hand the http request received is saved in local request file by response playback processor,
In, response playback processor needs to save http request according to reception sequence when saving the http request received;For example, answering
After answering the http request that playback processor receives request of loading processor A, the http request is saved in request file, so
After the http request for receiving request of loading processor B afterwards, the http request is saved in request file, the http request position
Behind the http request of request of loading processor A.Web services of the another aspect response playback processor according to user preset
The IP address of device and port, and it is corresponding according to the reception of http request sequence the http request received to be successively sent to this
Web server.
Finally, web server after receiving http request, can respond, and it is corresponding to construct the http request
Response information is sent to response playback processor;Here, response playback processor is received sending to web server
It is to wait for receiving after that is, response playback processor sends a http request using serial sending method when http request
The response information that web server returns just is sent next after receiving the response information of web server return
Http request to web server, and so on;It so, it is possible to guarantee that response playback processor after sending http request, receives
Response information be the corresponding response information of the http request, asked so that response playback processor can establish http
It seeks the corresponding relationship with response information, and the corresponding relationship of http request and response information is saved in local
In response file;Meanwhile response playback processor is saved according to reception sequence in response file and is received
Response information.
When response playback processor is sending all http requests received, and it is corresponding to receive all http requests
After response information, it is believed that the recording work of response playback processor finishes, and then the mailbox according to setting, recording is finished
Prompt mail be sent to user, user can be by the field value of status in the attribute of response playback processor by 1 modification
It is 0, sets playback mode for the operating mode of response playback processor, while the response of response playback processor is literary
Response information and http request are saved in part copies that http request is corresponding to ask to the corresponding relationship of response information
It asks in loading processing device, in this way, request of loading processor just preserves the http request of generation and corresponding response information.
In this preferred embodiment, response playback processor can only record a response information, subsequent to carry out reversely
When the test of proxy server, the response information prerecorded can be directly utilized.
It should be noted that above-mentioned step 201 ~ step 202 is that request of loading processor generates http request and answers
The process that playback processor records response information is answered, belongs to the preparation stage in Reverse Proxy test process, instead
It is following step 203 steps 205 to the real test phase of proxy server;The generation of a http request can only be carried out
With the recording of a response information, when carrying out the test of Reverse Proxy, can directly using http request and
Response information, directly execution step 203.
Step 203, pre-generated http request is sent to Reverse Proxy by request of loading processor.
Specifically, user configures the transmission frequency of http request according to testing requirement on request of loading processor in advance;
After response playback processor records response information, so that it may carry out the test of Reverse Proxy.
As shown in figure 4, each request of loading processor is according to preset when carrying out the test of Reverse Proxy
The genesis sequence of the transmission frequency of http request and local http request, is sent to reverse proxy service for the http request of generation
Device;Here, there can be more than one request of loading processor in this preferred embodiment, therefore carry out Reverse Proxy
When test, can with some request of loading processor to the http request that Reverse Proxy is sent be according to web services
What the Request Log information of device generated, remaining request of loading processor to the http request that Reverse Proxy is sent be according to
It is generated according to the http information of user's input.
Step 204, the http request received is transmitted to response playback processor by Reverse Proxy, and receives response
The response information that playback processor returned after receiving http request prerecord, which is transmitted to
Corresponding request of loading processor.
Specifically, as shown in figure 4, Reverse Proxy receive request of loading processor transmission http request after,
Http request is transmitted to response playback processor, response playback processor is according to the http request and response locally saved
The corresponding relationship of information finds the corresponding response information of the http request received, the response information that then will be found
Return to Reverse Proxy.Here, Reverse Proxy is established after receiving http request for each http request
One session channel, the session channel is as between request of loading processor, Reverse Proxy and response playback processor
Interaction channel, by the session channel, received http request can be transmitted at response playback by Reverse Proxy
Device is managed, then receives the response information that response playback processor returns, and response information is sent to sending should
The request of loading processor of http request;During the http request and response information exchange, request of loading processing
Session channel between session channel, Reverse Proxy between device and Reverse Proxy and response playback processor
It will always exist, until the response information that response playback processor returns is sent request of loading by Reverse Proxy
Processor, i.e., after the completion of complete response session, Reverse Proxy just releases the session channel established for the http request
It puts, will not influence each other between the different sessions channel of foundation, so that it is guaranteed that Reverse Proxy can will receive
Response information is transmitted to request of loading processor corresponding to the corresponding http request of response information.
In this preferred embodiment, response playback processor is because prerecorded true in web server
Response information, therefore, when carrying out the test of Reverse Proxy, it is no longer necessary to which web server is to reverse proxy service
Device sends response information, but by the work of response playback processor substitution web server, by what is prerecorded
Response information is sent to Reverse Proxy.
Wherein, response playback processor, can be according to preparatory when sending response information to Reverse Proxy
The forward delay interval fixed value of setting sends response information;Alternatively, since web server is rung under different request pressure
The speed answered can be different, therefore in order to realize that response playback processor can preferably simulate the work of web server, Yong Huxu
To configure the forward delay interval section of response information in web server in advance according to testing requirement, web server is from anti-
After receiving http request to proxy server, a specific time value can be randomly choosed in preset forward delay interval section,
Then response information is sent as forward delay interval to Reverse Proxy according to the specific time value selected.
Step 205, request of loading processor is by the response information received from Reverse Proxy and locally default
Response information be compared, obtain the test result of Reverse Proxy according to comparison result.
Specifically, multiple response time sections are set in request of loading processor in advance, such as: 0 ~ 1000ms, 1000ms ~
2000ms, 2000ms ~ 5000ms, it is greater than 5000ms.
Since request of loading processor is to send http request in sequence to Reverse Proxy, reverse proxy service
Device is also to give response playback processor according to the sequence forwarding http request for receiving http request, therefore, request of loading processor
After response information is received from Reverse Proxy, the reception sequence according to response information can find corresponding
Http request finds the http request pair then in the corresponding relationship of the http request and response information that locally save
The response information answered carries out the response information found with the response information received from Reverse Proxy
Compare, judges whether the information in two response information is identical.
If the information in two response information is not identical, indicate by Reverse Proxy forwarding
Response information does not meet expection, and the function of Reverse Proxy has exception, and therefore, it is necessary to will be directed to the report of the exception
Alert mail is sent to preset subscriber mailbox, alarms to user, so that user debugs Reverse Proxy;Wherein,
It include following content in alarm mail: the abnormal response information that is received from Reverse Proxy, abnormal
The corresponding http request of response information, the corresponding response information of the http request locally saved.
If the information in two response information is identical, the response by Reverse Proxy forwarding is indicated
Information meets expection, and the function of Reverse Proxy is normal, and therefore, request of loading processor needs to send test report to
Preset subscriber mailbox;Wherein, test report includes the correlation function data of Reverse Proxy, the correlation function data packet
Include the following contents: the corresponding response letter of quantity, section of each response time for the http request that request of loading server is sent
Return value in the number of breath, the average value of response time and the response information that receives.
Wherein, request of loading processor will start a corresponding timer, directly after one http request of every transmission
To the timer is stopped when receiving the corresponding response information of the http request, is then determined and responded according to the time of timer
Time judges the response time section where the response time, the Counter Value of response time section is then added 1.Request of loading
Processor can also calculate the average value of the response time of http request according to the determining response time.Request of loading processor is received
To response information in information header in will carry the return value of http request, which refers to http protocol status
Code mainly includes following five classes return value: return value 1xx, indicates to retain;Return value is 2xx, indicates that request is properly received;
Return value is 3xx, is expressed as completing the further refinement request of request user needs;Return value is 4xx, and it is wrong to indicate that user requests
Accidentally;Return value is 5xx, indicates Reverse Proxy mistake.
To realize above system, as shown in Figure 1, in the test macro of the reverse proxy:
Request of loading processor 10, for the http request pre-generated to be sent to Reverse Proxy 12;
Reverse Proxy 12 for the http request received to be transmitted to response playback processor 11, and receives institute
The response information prerecorded that response playback processor 11 returns after receiving http request is stated, by the response
Information is transmitted to the request of loading processor 10;
Request of loading processor 10, the response information for being also used to receive from the Reverse Proxy 12 and sheet
The preset response information in ground is compared, and obtains the test result of the Reverse Proxy 12 according to comparison result.
Wherein, the request of loading processor 10 pre-generates http request, specifically: web server is stored in advance
Request Log file, the Request Log file of the web server include the Request Log information of web server;From the web
Field is extracted in the Request Log information of server;Preset http request template is filled using the field of extraction, generates http
Request.
Or, the request of loading processor 10 pre-generates http request, specifically: receive the http letter of user's input
Breath;Preset http request template is filled using the http information of user's input, generates http request.
Wherein, the response playback processor 11 prerecords response information, specifically: it receives and stores request and adds
The http request that borne processor or browser are sent;The http request received is transmitted to web server, and receives the web
The response information for the correspondence http request that server returns;Store the response information and response information
With the corresponding relationship of http request.
Wherein, in request of loading processor 10 preset response information, specifically: request of loading processor receive from
The corresponding relationship of response information and response information and http request that response playback processor copies out.
Wherein, the response playback processor 11 returns to the response information prerecorded after receiving http request,
Specifically: according to the corresponding relationship of preset http request and response information, it is corresponding to find the http request
Response information;According to the random value in pre-set forward delay interval fixed value or forward delay interval section, by what is found
Response information returns to Reverse Proxy.
Wherein, the request of loading processor 10 obtains the test knot of the Reverse Proxy according to comparison result
Fruit, specifically: if the information in two response information is not identical, judge that the function of Reverse Proxy exists
It is abnormal, preset subscriber mailbox is sent by alarm mail;It include: to be received from Reverse Proxy in the alarm mail
The corresponding http request of response information, the local preset http request pair of abnormal response information, exception
The response information answered;If the information in two response information is identical, the function of Reverse Proxy is judged
Can be normal, preset subscriber mailbox is sent by test report;The test report include: the http request of transmission quantity,
Number, the average value of response time and the response information received of the corresponding response information of each response time section
In return value.
Above-mentioned technical proposal of the invention specifically have it is following the utility model has the advantages that
1, when being tested, the test http request that http request true on line and user construct is combined, next pair
Reverse Proxy is tested, and can comprehensively be tested Reverse Proxy.
2, response playback processor returns to response information using random forward delay interval, can be realized online lower die
True web services environment on quasi- line, to guarantee that the test result of Reverse Proxy is consistent with test result on line.
3, request of loading processor can automatically alarm when judging that Reverse Proxy occurs abnormal,
So that tester debugs Reverse Proxy in time, testing efficiency is improved.
4, the transmission frequency of http request on request of loading processor can be adjusted, the flat of programming count response time is capable of
Mean value, and the return value of http request can be automatically recorded, greatly improve the testing efficiency of Reverse Proxy.
5, when carrying out the test of Reverse Proxy, http request is generated according to true request log on line, and
Response information also comes from true web server, therefore in the clothes for not needing to construct various complexity on a web server
Business, does not need in the case where constructing http request manually, it will be able to simulate true http request and response environment, significantly yet
The time required for environmental structure is reduced, the testing efficiency of Reverse Proxy is improved.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.
Claims (12)
1. a kind of test method of reverse proxy, which is characterized in that this method comprises:
Pre-generated http request is sent to Reverse Proxy by request of loading processor;
The http request received is transmitted to response playback processor by the Reverse Proxy, and receives the response playback
The response information corresponding with the http request that processor returned after receiving http request prerecord, by institute
It states response information and is transmitted to the request of loading processor;
The request of loading processor by the response information received from the Reverse Proxy and it is local it is preset with
The corresponding response information of the http request is compared, and obtains the Reverse Proxy according to comparison result
Test result;
The method that the response playback processor prerecords response information are as follows:
Response playback processor receives and stores the http request that request of loading processor or browser are sent;
The http request received is transmitted to web server by response playback processor, and receives pair that the web server returns
Answer the response information of the http request;
Response playback processor stores the corresponding relationship of the response information and response information and http request.
2. the method according to claim 1, wherein the request of loading processor pre-generates http request
Method are as follows:
The Request Log file of web server, the Request Log file of the web server is stored in advance in request of loading processor
Request Log information comprising web server;
Request of loading processor extracts field from the Request Log information of the web server;
Request of loading processor fills preset http request template using the field extracted, and generates http request.
3. the method according to claim 1, wherein the request of loading processor pre-generates http request
Method are as follows:
Request of loading processor receives the http information of user's input;
Request of loading processor fills preset http request template using the http information of user's input, generates http request.
4. the method according to claim 1, wherein presetting the side of response information in request of loading processor
Method are as follows:
Request of loading processor receive the response information that is copied out from response playback processor and response information with
The corresponding relationship of http request.
5. the method according to claim 1, wherein the response playback processor returns after receiving http request
The method for returning the response information corresponding with the http request prerecorded are as follows:
Corresponding relationship of the response playback processor according to preset http request and response information, finds the http request
Corresponding response information;
Response playback processor will be found according to the random value in pre-set forward delay interval fixed value or forward delay interval section
Response information return to Reverse Proxy.
6. the method according to claim 1, wherein described obtain the reverse proxy service according to comparison result
The test result of device, specifically:
If the information in two response information is not identical, it is abnormal to judge that the function of Reverse Proxy exists,
Preset subscriber mailbox is sent by alarm mail;It include: the exception received from Reverse Proxy in the alarm mail
Response information, the abnormal corresponding http request of response information, the local preset http request it is corresponding
Response information;
If the information in two response information is identical, judges that the function of Reverse Proxy is normal, will test
Report is sent to preset subscriber mailbox;The test report includes: the quantity of the http request of transmission, section of each response time
Return value in the number of corresponding response information, the average value of response time and the response information that receives.
7. a kind of test macro of reverse proxy, which is characterized in that the system includes: request of loading processor, reverse proxy clothes
Business device, response playback processor;Wherein,
Request of loading processor, for the http request pre-generated to be sent to Reverse Proxy;
Reverse Proxy for the http request received to be transmitted to response playback processor, and receives the response and returns
The response information corresponding with the http request prerecorded that processor returns after receiving http request is put, it will
The response information is transmitted to the request of loading processor;
Request of loading processor, the response information for being also used to receive from the Reverse Proxy and local are preset
Response information corresponding with the http request is compared, and obtains the Reverse Proxy according to comparison result
Test result;
The response playback processor prerecords response information, specifically:
Response playback processor receives and stores the http request that request of loading processor or browser are sent;
The http request received is transmitted to web server by response playback processor, and receives pair that the web server returns
Answer the response information of the http request;
Response playback processor stores the corresponding relationship of the response information and response information and http request.
8. system according to claim 7, which is characterized in that the request of loading processor pre-generates http request,
Specifically:
The Request Log file of web server is stored in advance, the Request Log file of the web server includes web server
Request Log information;
Field is extracted from the Request Log information of the web server;
Preset http request template is filled using the field of extraction, generates http request.
9. system according to claim 7, which is characterized in that the request of loading processor pre-generates http request,
Specifically:
Receive the http information of user's input;
Preset http request template is filled using the http information of user's input, generates http request.
10. system according to claim 7, which is characterized in that response information is preset in request of loading processor,
Specifically:
Request of loading processor receive the response information that is copied out from response playback processor and response information with
The corresponding relationship of http request.
11. system according to claim 7, which is characterized in that the response playback processor is after receiving http request
The response information corresponding with the http request prerecorded is returned, specifically:
According to the corresponding relationship of preset http request and response information, the corresponding response of the http request is found
Information;
According to the random value in pre-set forward delay interval fixed value or forward delay interval section, the response information that will be found
Return to Reverse Proxy.
12. system according to claim 7, which is characterized in that the request of loading processor is obtained according to comparison result
The test result of the Reverse Proxy, specifically:
If the information in two response information is not identical, it is abnormal to judge that the function of Reverse Proxy exists,
Preset subscriber mailbox is sent by alarm mail;It include: the exception received from Reverse Proxy in the alarm mail
Response information, the abnormal corresponding http request of response information, the local preset http request it is corresponding
Response information;
If the information in two response information is identical, judges that the function of Reverse Proxy is normal, will test
Report is sent to preset subscriber mailbox;The test report includes: the quantity of the http request of transmission, section of each response time
Return value in the number of corresponding response information, the average value of response time and the response information that receives.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210431552.9A CN103795762B (en) | 2012-11-01 | 2012-11-01 | A kind of test method and system of reverse proxy |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210431552.9A CN103795762B (en) | 2012-11-01 | 2012-11-01 | A kind of test method and system of reverse proxy |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103795762A CN103795762A (en) | 2014-05-14 |
CN103795762B true CN103795762B (en) | 2019-07-02 |
Family
ID=50671042
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210431552.9A Active CN103795762B (en) | 2012-11-01 | 2012-11-01 | A kind of test method and system of reverse proxy |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103795762B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105988917B (en) * | 2015-02-26 | 2020-08-04 | 小米科技有限责任公司 | Abnormal information acquisition method and device |
CN105450476B (en) * | 2015-12-07 | 2019-03-19 | 北京先进数通信息技术股份公司 | A kind of regression test system and test method |
CN105959179B (en) * | 2016-06-08 | 2019-02-05 | 微梦创科网络科技(中国)有限公司 | A kind of reverse proxy nginx test macro and method |
CN106209995B (en) * | 2016-06-29 | 2019-11-12 | 武汉斗鱼网络科技有限公司 | A kind of WEB exploitation debugging system and method based on Reverse Proxy |
CN106802864A (en) * | 2016-12-30 | 2017-06-06 | 中国银联股份有限公司 | A kind of method of testing and device based on financial sector |
CN107040433A (en) * | 2017-05-10 | 2017-08-11 | 福建网龙计算机网络信息技术有限公司 | A kind of automated testing method and system |
CN107480179B (en) * | 2017-07-04 | 2020-06-16 | 阿里巴巴集团控股有限公司 | Detection method and device and electronic equipment |
CN108111345B (en) * | 2017-12-19 | 2021-04-13 | 易知成都数据服务有限公司 | Visual reverse proxy configuration and test method |
CN109960647A (en) * | 2017-12-26 | 2019-07-02 | 腾讯科技(深圳)有限公司 | A kind of method for testing software and device calculate equipment and storage medium |
CN109743302A (en) * | 2018-12-24 | 2019-05-10 | 中电福富信息科技有限公司 | A kind of audit playback system of https/http agreement |
CN109525679A (en) * | 2019-01-08 | 2019-03-26 | 郑州云海信息技术有限公司 | A kind of web file server test method based on http protocol |
CN110691133B (en) * | 2019-09-29 | 2020-11-24 | 河南信大网御科技有限公司 | Web service mimicry system and method applied to network communication equipment |
CN113381976B (en) * | 2021-05-11 | 2022-06-24 | 北京丁牛科技有限公司 | Smuggling attack testing method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1805381A (en) * | 2005-01-13 | 2006-07-19 | 中兴通讯股份有限公司 | Multi-network element emulation test system and implementation method |
CN1848777A (en) * | 2006-01-19 | 2006-10-18 | 华为技术有限公司 | Protocol simulation testing device |
WO2008137522A3 (en) * | 2007-05-04 | 2010-05-20 | Sitespect, Inc. | Method and system for testing variations of website content |
CN102684934A (en) * | 2011-03-17 | 2012-09-19 | 阿里巴巴集团控股有限公司 | Method and system for monitoring property of web application program and web server |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7925692B2 (en) * | 2007-01-15 | 2011-04-12 | Microsoft Corporation | Method and system for testing internet software |
-
2012
- 2012-11-01 CN CN201210431552.9A patent/CN103795762B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1805381A (en) * | 2005-01-13 | 2006-07-19 | 中兴通讯股份有限公司 | Multi-network element emulation test system and implementation method |
CN1848777A (en) * | 2006-01-19 | 2006-10-18 | 华为技术有限公司 | Protocol simulation testing device |
WO2008137522A3 (en) * | 2007-05-04 | 2010-05-20 | Sitespect, Inc. | Method and system for testing variations of website content |
CN102684934A (en) * | 2011-03-17 | 2012-09-19 | 阿里巴巴集团控股有限公司 | Method and system for monitoring property of web application program and web server |
Also Published As
Publication number | Publication date |
---|---|
CN103795762A (en) | 2014-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103795762B (en) | A kind of test method and system of reverse proxy | |
KR102298268B1 (en) | An apparatus for network monitoring based on edge computing and method thereof, and system | |
CN104767775B (en) | Web application information push method and system | |
CN102655481B (en) | A kind of instant messaging chat content inspection method based on webpage and system | |
CN104427296B (en) | The transmission method and device of Media Stream in video conference | |
CN107040816A (en) | A kind of client application operation exception analysis method and device | |
CN110519177A (en) | A kind of network flow identification method and relevant device | |
CN104333562B (en) | Data pack transmission method and device | |
CN102497427B (en) | Method and device for realizing data acquisition services of renewable energy source monitoring system | |
CN110196715A (en) | A kind of code generating system and method | |
CN107085549B (en) | Method and device for generating fault information | |
CN112988608B (en) | Data testing method and device, computer equipment and storage medium | |
CN105429958A (en) | Enterprise application platform system based on Android development | |
CN104580380B (en) | The synchronous method and system of logging state | |
CN108076017A (en) | The protocol analysis method and device of a kind of data packet | |
CN109218370A (en) | Message method and device, electronic equipment | |
CN110191131A (en) | A kind of file sharing method, device, system, server and storage medium | |
CN107864058B (en) | Fault judgment method and device | |
CN112383509A (en) | Internet of things equipment safety monitoring system and method based on data flow | |
CN107111624A (en) | Reception device, dispensing device and data processing method | |
CN103595611B (en) | The realization method and system and equipment of instant messaging application | |
CN105721274B (en) | The fusion method and device of one kind of multiple instant messagings | |
CN104468771B (en) | The determination method and device in geographical location | |
CN107809681B (en) | It is sliced the method and device of transmission of video | |
CN109714448A (en) | The internet information statistical method and device of PON terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |