jofomah / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Allow proxy settings for emulator developing behind a firewall #261

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I sit behind a restrictive firewall and need to use a proxy with authentication 
to test within an emulator.
The DefaultHttpClient used in CloudmadeUtil, in MapTileDownloader.TileLoader 
and in GpxToPHPUploader will not reflect proxy settings.

Either try to fetch proxy settings from the network connections (if possible) 
or allow integrators to add their own instance of an HttpClient, e.g. add a 
method to MapView: 
public void setHttpClient (HttpClient client) { ...}

The HttpClient may look like

public class ProxiedHttpClient extends DefaultHttpClient {
    public ProxiedHttpClient () {
        super();
        HttpHost proxy = new HttpHost(myProxyHost, myProxyPort, "http");
        this.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
                proxy);
        this.getCredentialsProvider().setCredentials(
                new AuthScope(myProxyHost, myProxyPort),
                new UsernamePasswordCredentials(myUserName, myPassword));

    }
}

Original issue reported on code.google.com by Cornelia.Schalueck@googlemail.com on 15 Sep 2011 at 8:29

GoogleCodeExporter commented 8 years ago

Original comment by neilboyd on 15 Sep 2011 at 9:25

GoogleCodeExporter commented 8 years ago
This is now possible via the work done in issue 432.

Original comment by kurtzm...@gmail.com on 24 Jun 2013 at 12:51