Skip to content

Commit 6829dae

Browse files
committed
feat: ReverseTcpProxy和ReverseHttpProxy的修饰符进行统一调整
1 parent d317d93 commit 6829dae

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/main/java/top/meethigher/proxy/http/ReverseHttpProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public class ReverseHttpProxy {
208208
);
209209

210210

211-
public ReverseHttpProxy(HttpServer httpServer, HttpClient httpClient, Router router, String name) {
211+
protected ReverseHttpProxy(HttpServer httpServer, HttpClient httpClient, Router router, String name) {
212212
this.httpServer = httpServer;
213213
this.httpClient = httpClient;
214214
this.router = router;

src/main/java/top/meethigher/proxy/tcp/ReverseTcpProxy.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ public class ReverseTcpProxy {
2323

2424
private static final Logger log = LoggerFactory.getLogger(ReverseTcpProxy.class);
2525

26-
private static final char[] ID_CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
26+
protected static final char[] ID_CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
2727

28-
private String sourceHost = "0.0.0.0";
28+
protected String sourceHost = "0.0.0.0";
2929

30-
private int sourcePort = 999;
30+
protected int sourcePort = 999;
3131

32-
private final Handler<NetSocket> connectHandler;
33-
private final NetServer netServer;
34-
private final NetClient netClient;
35-
private final String targetHost;
36-
private final int targetPort;
37-
private final String name;
32+
protected final Handler<NetSocket> connectHandler;
33+
protected final NetServer netServer;
34+
protected final NetClient netClient;
35+
protected final String targetHost;
36+
protected final int targetPort;
37+
protected final String name;
3838

39-
private ReverseTcpProxy(NetServer netServer, NetClient netClient,
40-
String targetHost, int targetPort, String name) {
39+
protected ReverseTcpProxy(NetServer netServer, NetClient netClient,
40+
String targetHost, int targetPort, String name) {
4141
this.name = name;
4242
this.targetHost = targetHost;
4343
this.targetPort = targetPort;
@@ -133,7 +133,7 @@ public ReverseTcpProxy host(String host) {
133133
}
134134

135135

136-
private static String generateName() {
136+
protected static String generateName() {
137137
final String prefix = "ReverseTcpProxy-";
138138
try {
139139
// 池号对于虚拟机来说是全局的,以避免在类加载器范围的环境中池号重叠

0 commit comments

Comments
 (0)