HTTP Replay

One of utility's main plugin is <httpReplay>. It allows replaying HTTP requests snapshots made from different tools like Fiddler, TcpMon, etc...

To run this event is must be configured as the following:

<jScheConfigs>

<jScheConfig>
...
<httpReplay>
<requestFile>XXX.hr</requestFile>

<host>localhost</host>

<port>80</port>

</httpReplay>
</jScheConfig>
</jScheConfigs>

Here "host" and "port" are optional parameters specifying destination host:port where to send the request. If not set used the ones captured in the request.

"XXX.hr" request - file containing the captured HTTP request as in the following examples. Default directory for requests files as for all events is the configuration folder, you may specify full paths as well.

Request example:


POST /view/Push_Home/view/someLocalPath?delay=0sec HTTP/1.1
Host: the-host:8080
Content-Length: 125
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://localhost:8080/view/Push_Home/
Accept-Encoding: gzip, deflate
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,id;q=0.2,uk;q=0.2
Cookie: JSESSIONID=blablabla

name=EMAIL_NOTIFICATION_LIST&value=virtualvat%40gmail.com%2C+someOtherEmail%40company.com&name=PUSH_PLATFORM&value=WIN2K8_X64


Note "Host" header in this example, if "host" and "port" parameters are omitted this data is used to specify the destination.

Some most simple example:

GET / HTTP/1.1

Note empty line at the end. This request example doesn't have "Host" header specified thus "host" and "port" parameters in the event are mandatory to specify the destination.

By default plugin will report first line of the HTTP response (e.g. "200 Ok") in the log, to log full HTTP response define the "detailedHttpResponse" system property e.g. as it is proposed in the "update_config.bat".

As standalone application.

The plugin also works as the standalone application allowing to send single HTTP requests or multiple repetitions of it (e.g. for load test). Use the "httpReplay.bat" for that.

To send the single request:

C:\PathToUtility\jSche\lib\httpReplay.bat test.hr google.com 80

Again, host and port are optional here - if not specified endpoint from the "Host" header of the request snapshot "test.hr" will be used to determine the destination (as "orl-reg-vsbld23:8080" in the first request example).

For multiple requests use the following signature:

httpReplay.bat -batch(100,10,1000) C:\Temp\dos\dos.request localhost 80

Here 100 - total number of requests to send, 10 - number of requests in batch to send simultaneously, 1000 - delay in ms between batches (1 second for example). Last and last 2 parameters can be omitted. If delay is omitted no delay will be applied between batches, if both last parameters absent all requests will be sent in the only batch.

If you run it with no parameters brief help is displayed.

The HttpSender can be separated from the Scheduler if only manual HTTP requests sending is required - keep only "httpReplay.bat", "jsche-core-1.3.0.jar", "jsche-event-httpreplay-2.1.1.jar", "log4j-1.2.17.jar" and "log4j_con.xml" at any location for use.