public function applyHttpBasicAuthForHost($hostname, $url)
{
// get the auth credentials
$credentials = $this->getHttpBasicAuthForHost($hostname);
// get the proxy server
//
// this is an absolutely *horrible* hack, as we're relying on
// there being absolutely no parallel testing going on for this
// to work
//
// that said, SauceConnect also relies on exactly the same hack,
// so as long as it works at all, so will this hack
$proxySession = new BrowserMobProxySession('http://localhost:9090', 9091);
$proxySession->setHttpBasicAuth($hostname, $credentials['user'], $credentials['pass']);
// all done
return $url;
}