I am trying to create an API proxy for my application, but I am getting some weird timeouts on Heroku.
They say the following:
2012-12-10T12:49:24+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path=/api/v1/users/me host=host.herokuapp.com fwd=174.129.79.221 dyno=web.1 queue= wait= connect= service=30000ms status=503 bytes=0
The code looks something like this:
$request = curl_init(); curl_setopt($request, CURLOPT_URL, $url); curl_setopt($request, CURLOPT_USERAGENT, 'AppProxy/1.0'); curl_setopt($request, CURLOPT_HTTPHEADER, array( 'Accept: application/json', 'Authorization: Basic ' . $authorization, 'X-Requested-With: XMLHttpRequest' )); curl_setopt($request, CURLOPT_VERBOSE, 1); curl_setopt($request, CURLOPT_RETURNTRANSFER, true); curl_setopt($request, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($request); echo curl_errno($request) . "<br />"; echo curl_error($request) . "<br />"; echo $httpStatus = curl_getinfo($request, CURLINFO_HTTP_CODE) . "<br />"; curl_close($request); echo $response . "<br />";
Is something wrong, or am I missing something in the code to make it work? Has anyone had the same problem on Geroku?
Thanks in advance...
William Lepinski
source share