mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-05 15:47:23 +00:00
JPProxy update
This commit is contained in:
@@ -2,39 +2,38 @@ package com.jpexs.proxy;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Mark Boyns
|
||||
*/
|
||||
class Https extends HttpConnection {
|
||||
boolean proxy = false;
|
||||
|
||||
Https(String host, int port) throws IOException {
|
||||
super(host, port);
|
||||
}
|
||||
boolean proxy = false;
|
||||
|
||||
Https(String host, int port, boolean isProxy) throws IOException {
|
||||
this(host, port);
|
||||
proxy = isProxy;
|
||||
}
|
||||
Https(String host, int port) throws IOException {
|
||||
super(host, port);
|
||||
}
|
||||
|
||||
public void sendRequest(Request request)
|
||||
throws IOException, RetryRequestException {
|
||||
if (proxy) {
|
||||
super.sendRequest(request);
|
||||
} else {
|
||||
/* nothing */
|
||||
}
|
||||
}
|
||||
Https(String host, int port, boolean isProxy) throws IOException {
|
||||
this(host, port);
|
||||
proxy = isProxy;
|
||||
}
|
||||
|
||||
public Reply recvReply(Request request)
|
||||
throws IOException, RetryRequestException {
|
||||
Reply reply = new Reply(getInputStream());
|
||||
if (proxy) {
|
||||
reply.read();
|
||||
} else {
|
||||
reply.statusLine = "HTTP/1.0 200 Connection established";
|
||||
reply.setHeaderField("Proxy-agent", "ASDec");
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user