Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure if you ever figured this out but all I needed to do was pass the headers from the original request onto the proxied request:</p> <pre><code> private HttpResponse download(String url, Header[] headers) { DefaultHttpClient seed = new DefaultHttpClient(); SchemeRegistry registry = new SchemeRegistry(); registry.register( new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); SingleClientConnManager mgr = new MyClientConnManager(seed.getParams(), registry); DefaultHttpClient http = new DefaultHttpClient(mgr, seed.getParams()); HttpGet method = new HttpGet(url); for (Header header : headers) { method.addHeader(header); } HttpResponse response = null; try { Log.d(getClass().getName(), "starting download"); response = http.execute(method); Log.d(getClass().getName(), "downloaded"); }catch(java.net.UnknownHostException e) { Intent i=new Intent("org.prx.errorInStream"); mContext.sendBroadcast(i); } catch (ClientProtocolException e) { Log.e(getClass().getName(), "Error downloading", e); } catch (IOException e) { Log.e(getClass().getName(), "Error downloading", e); } return response; </code></pre> <p>}</p> <pre><code>private void processRequest(HttpRequest request, Socket client) throws IllegalStateException, IOException { if (request == null) { return; } Log.d(getClass().getName(), "processing"); String url = request.getRequestLine().getUri(); HttpResponse realResponse = download(url, request.getAllHeaders()); if (realResponse == null) { return; } ... </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload