Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Ops #44

Merged
merged 3 commits into from
Feb 16, 2017
Merged

Ops #44

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/main/java/me/checkium/vhackapi/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,40 +219,12 @@ public String call() {
return null;

}

/**
* Sets a proxy for the system
* @param proxyUrl The proxy's IP/URL
* @param proxyPort The proxy's port
*/
public static void useProxy(String proxyUrl, int proxyPort){

System.setProperty("http.proxyHost", proxyUrl);
System.setProperty("http.proxyPort", String.valueOf(proxyPort));

}

public static <T extends WaitingTask> void setWaitingTask(T wt){

task = wt;

}

/**
* Sets a proxy that requires auth for the system
* @param proxyUrl The proxy's IP/URL
* @param proxyPort The proxy's port
* @param username The proxy's username
* @param password The proxy's password
*/
public static void useProxy(String proxyUrl, int proxyPort, String username, String password){

System.setProperty("http.proxyHost", proxyUrl);
System.setProperty("http.proxyPort", String.valueOf(proxyPort));
System.setProperty("http.proxyUser", username);
System.setProperty("http.proxyPassword", password);

}

private static byte[] m9179a(byte[] arrby, int n2, int n3, byte[] arrby2, int n4, byte[] arrby3) {
int n5 = n3 > 0 ? arrby[n2] << 24 >>> 8 : 0;
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/me/checkium/vhackapi/vHackAPIBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,36 @@ public class vHackAPIBuilder {
protected String username;
protected String email;

/**
* Sets a proxy for the system
* @param proxyUrl The proxy's IP/URL
* @param proxyPort The proxy's port
*/
public vHackAPIBuilder useProxy(String proxyUrl, int proxyPort){

System.setProperty("http.proxyHost", proxyUrl);
System.setProperty("http.proxyPort", String.valueOf(proxyPort));
return this;

}

/**
* Sets a proxy that requires auth for the system
* @param proxyUrl The proxy's IP/URL
* @param proxyPort The proxy's port
* @param username The proxy's username
* @param password The proxy's password
*/
public vHackAPIBuilder useProxy(String proxyUrl, int proxyPort, String username, String password){

System.setProperty("http.proxyHost", proxyUrl);
System.setProperty("http.proxyPort", String.valueOf(proxyPort));
System.setProperty("http.proxyUser", username);
System.setProperty("http.proxyPassword", password);
return this;

}

public vHackAPIBuilder username(String username) {
this.username = username;
return this;
Expand Down