google / java-photoslibrary

Java client library for the Google Photos Library API
http://developers.google.com/photos
Apache License 2.0
108 stars 59 forks source link

Unable to configure a proxy for the client #25

Closed wmorland closed 4 years ago

wmorland commented 4 years ago

When creating HttpClients the code just calls HttpClientBuilder.create().build(); e.g. https://github.com/google/java-photoslibrary/blob/1ff35779cd018905dcaa35cff1a30308ff60b266/photoslibraryapi/src/main/java/com/google/photos/library/v1/upload/PhotosLibraryUploadCallable.java#L212

This means that it is not possible to configure a proxy when using the PhotosLibraryClient and if this is required by the network setup it results in a java.net.SocketException: Network is unreachable (connect failed). The easiest fix would be to just call .useSystemProperties before calling .build on HttpClientBuilder and that would allow developers to specify a proxy using the System Properties.

wmorland commented 4 years ago

Not sure who the best person to handle this is but would it be possible to publish a new release including this fix please? @Tmbao @katmle

wmorland commented 4 years ago

This is now available in release v1.5.0 https://github.com/google/java-photoslibrary/releases/tag/v1.5.0

Thank you!