-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProxy.java
More file actions
35 lines (28 loc) · 1.01 KB
/
Proxy.java
File metadata and controls
35 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// java examples.general.Proxy YOUR_TOKEN socks5://127.0.0.1:1080
package examples.general;
import com.lolzteam.LolzteamClient;
import com.lolzteam.models.*;
import java.time.Duration;
public class Proxy {
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.err.println("Usage: Proxy <TOKEN> <PROXY_URL>");
System.exit(1);
}
String token = args[0];
String proxyUrl = args[1];
LolzteamClient client = LolzteamClient.builder(token)
.proxy(proxyUrl)
.maxRetries(3)
.timeout(Duration.ofSeconds(15))
.build();
System.out.println("proxy: " + proxyUrl);
try {
UsersGetResponse resp = client.forum().usersGet(1L, null);
User user = resp.getUser();
System.out.println("username: " + user.getUsername());
} catch (Exception e) {
System.err.println("err: " + e.getMessage());
}
}
}