aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-03-03 18:17:04 -0800
committerScott Jackson <daneren2005@gmail.com>2015-03-03 18:17:04 -0800
commita0602c7759572c4af8947688132f8f7e97fb1563 (patch)
tree9d41e2edfaad72ca5b2a0b524c0421bb40f4a06d /src/github
parent3a878a9f5612e469532731e98ba8a75139f33ea5 (diff)
downloaddsub-a0602c7759572c4af8947688132f8f7e97fb1563.tar.gz
dsub-a0602c7759572c4af8947688132f8f7e97fb1563.tar.bz2
dsub-a0602c7759572c4af8947688132f8f7e97fb1563.zip
#320 Update with WebProxy using our custom httpClient (so we can bypass self-signed certs)
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/ChromeCastController.java2
-rw-r--r--src/github/daneren2005/dsub/service/DLNAController.java2
-rw-r--r--src/github/daneren2005/dsub/service/RESTMusicService.java5
-rw-r--r--src/github/daneren2005/dsub/service/RemoteController.java10
4 files changed, 17 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/ChromeCastController.java b/src/github/daneren2005/dsub/service/ChromeCastController.java
index 21ee6e13..a729ed4e 100644
--- a/src/github/daneren2005/dsub/service/ChromeCastController.java
+++ b/src/github/daneren2005/dsub/service/ChromeCastController.java
@@ -288,7 +288,7 @@ public class ChromeCastController extends RemoteController {
}
if(proxy == null) {
- proxy = new WebProxy(downloadService);
+ proxy = createWebProxy();
proxy.start();
}
} else if(proxy != null) {
diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java
index a2894a23..701034de 100644
--- a/src/github/daneren2005/dsub/service/DLNAController.java
+++ b/src/github/daneren2005/dsub/service/DLNAController.java
@@ -398,7 +398,7 @@ public class DLNAController extends RemoteController {
}
if(proxy == null) {
- proxy = new WebProxy(downloadService);
+ proxy = createWebProxy();
proxy.start();
}
} else if(proxy != null) {
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java
index 341b1158..307afc9a 100644
--- a/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -39,6 +39,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
@@ -1878,4 +1879,8 @@ public class RESTMusicService implements MusicService {
return Util.getRestUrl(context, method, instance, allowAltAddress);
}
}
+
+ public HttpClient getHttpClient() {
+ return httpClient;
+ }
}
diff --git a/src/github/daneren2005/dsub/service/RemoteController.java b/src/github/daneren2005/dsub/service/RemoteController.java
index 02deaf85..47730e8c 100644
--- a/src/github/daneren2005/dsub/service/RemoteController.java
+++ b/src/github/daneren2005/dsub/service/RemoteController.java
@@ -32,6 +32,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.RemoteStatus;
+import github.daneren2005.serverproxy.WebProxy;
public abstract class RemoteController {
private static final String TAG = RemoteController.class.getSimpleName();
@@ -95,4 +96,13 @@ public abstract class RemoteController {
queue.clear();
}
}
+
+ protected WebProxy createWebProxy() {
+ MusicService musicService = MusicServiceFactory.getMusicService(downloadService);
+ if(musicService instanceof RESTMusicService) {
+ return new WebProxy(downloadService, ((RESTMusicService)musicService).getHttpClient());
+ } else {
+ return new WebProxy(downloadService);
+ }
+ }
}