3

I want to get establish connection time to har like firebug providing by phantomjs !

Through phantomjs function page.onResourceReceived, I can only get start time and end time. I think the time between request to the start time is waiting time , the time is not detailed eoungh for me . Is there some way to get the establish connection time??

1 Answers1

2

HTTP connection management is not exposed and phantomjs is not an http proxy, so you won't be able to get this kind of information.

I have also tried W3C Performance Timings in th past... but window.performance timings are not supported in the current release. I hope this will be supported in the next major release.

You have only two interesting callbacks to get request timings : onResourceRequested and onResourceReceived. As the last one is invoked twice (begin reply and reply) it allows you to determine receiving time. That's the best you can collect per request: request wait time and request receiving time.

The best example you could find on this area is netsniff.

Cybermaxs
  • 23,654
  • 8
  • 77
  • 108