Link to home
Start Free TrialLog in
Avatar of Paulmul
Paulmul

asked on

Query HTTP server

Hi,

is there any way in bash to query the round trip time to a http server? I have to use the http protocol so ping is no good.  I have to compare this to ping. I thought wget might have something but I couldn't find what to use.

Thanks
Avatar of asbharadwaj
asbharadwaj

Iam not aware of any bash command for this purpose. But
You can write a small program that sends a HTTP Get request to the server
and measures the response time
Its really very simple
All you need to do is open a socket, connect to the server port 80 (or whatever the
server is listening to), note the time, send the http get request, wait for response,
note down time, calculate difference and you have the round trip time.
Avatar of Paulmul

ASKER

Can this be done in perl?  I am using perl and bash for this.
ASKER CERTIFIED SOLUTION
Avatar of asbharadwaj
asbharadwaj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paulmul

ASKER

I am also quite new to perl, I prefer it to C though
try curl, works great.