Update Proxy

Add header and support response
pull/144/head
okcaptain 12 months ago committed by GitHub
parent 6d28b574d8
commit a2709592c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/src/main/java/com/github/tvbox/osc/server/RemoteServer.java

@ -99,6 +99,7 @@ public class RemoteServer extends NanoHTTPD {
private Response getProxy(Object[] rs){
try {
if (rs[0] instanceof NanoHTTPD.Response) return (NanoHTTPD.Response) rs[0];
int code = (int) rs[0];
String mime = (String) rs[1];
InputStream stream = rs[2] != null ? (InputStream) rs[2] : null;
@ -139,6 +140,7 @@ public class RemoteServer extends NanoHTTPD {
}
if (fileName.equals("/proxy")) {
Map<String, String> params = session.getParms();
params.putAll(session.getHeaders());
if (params.containsKey("do")) {
Object[] rs = ApiConfig.get().proxyLocal(params);
return getProxy(rs);
@ -439,4 +441,4 @@ public class RemoteServer extends NanoHTTPD {
bos.close();
}
}
}

Loading…
Cancel
Save