mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-22 05:37:10 +00:00
40 lines
985 B
Java
40 lines
985 B
Java
package com.jpexs.proxy;
|
|
|
|
import java.io.IOException;
|
|
|
|
class HttpsThrough extends HttpConnection {
|
|
|
|
boolean proxy = false;
|
|
|
|
HttpsThrough(String host, int port) throws IOException {
|
|
super(host, port);
|
|
}
|
|
|
|
HttpsThrough(String host, int port, boolean isProxy) throws IOException {
|
|
this(host, port);
|
|
proxy = isProxy;
|
|
}
|
|
|
|
public void sendRequest(Request request)
|
|
throws IOException, RetryRequestException {
|
|
if (proxy) {
|
|
super.sendRequest(request);
|
|
} else {
|
|
/* nothing */
|
|
}
|
|
}
|
|
|
|
public Reply recvReply(Request request)
|
|
throws java.io.IOException, RetryRequestException {
|
|
Reply reply = new Reply(getInputStream());
|
|
if (proxy) {
|
|
reply.read();
|
|
} else {
|
|
reply.statusLine = "HTTP/1.0 200 Connection established";
|
|
reply.setHeaderField("Proxy-agent", ProxyConfig.appName);
|
|
}
|
|
|
|
return reply;
|
|
}
|
|
}
|