Parallel cUrl Requests

Posted at

Multi-processing the cUrl execute (on windows) can enable a very easy and fast way to roll a small-scale load/traffic test on a resource,
Although there are probably better ways (multi curl lib-python, curl_multi-php), this kind of "all include" one nice solution.

as a bonus, there is some xff (X-Forward-For) header input from text file.

the sample project is attached as rar, its open, free to use (under GPL).

-- get a compiled curl (w or w/o libssl32.dll, 32bit or 64bit, it really does not matter)

@echo off

set sUserAgent="Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1"
set sHOST=%1
set sIP=%2

::.\\curl.exe --header "X-Forwarded-For: %sIP%" --user-agent %sUserAgent% --referer %sHOST% --verbose %sHOST%
.\\curl.exe --header "X-Forwarded-For: %sIP%" --user-agent %sUserAgent% --referer %sHOST% --silent %sHOST%


@echo off
echo I am the runner

set HOST=__host.txt
set IP=__country_Afghanistan_20.txt

for /f "tokens=* delims= " %%a in (%HOST%) do (
for /f "tokens=* delims= " %%b in (%IP%) do (
start /b /min /low "cmd /c "call request.cmd %%a %%b