File tree 1 file changed +19
-2
lines changed
src/main/java/org/bbottema/javasocksproxyserver
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,16 @@ public class SocksServer {
15
15
private static final Logger LOGGER = LoggerFactory .getLogger (SocksServer .class );
16
16
17
17
private volatile boolean stopped = false ;
18
- private final int listenPort ;
18
+ private int listenPort ;
19
19
20
- private final ServerSocketFactory factory ;
20
+ private ServerSocketFactory factory ;
21
21
private Authenticator authenticator = null ;
22
22
23
+ public SocksServer () {
24
+ listenPort = 1080 ;
25
+ factory = ServerSocketFactory .getDefault ();
26
+ }
27
+
23
28
public SocksServer (int listenPort ) {
24
29
this .listenPort = listenPort ;
25
30
factory = ServerSocketFactory .getDefault ();
@@ -35,6 +40,18 @@ public SocksServer setAuthenticator(Authenticator authenticator) {
35
40
return this ;
36
41
}
37
42
43
+ @ Deprecated
44
+ public synchronized void start (int port ) {
45
+ start (port , ServerSocketFactory .getDefault ());
46
+ }
47
+
48
+ @ Deprecated
49
+ public synchronized void start (int port , ServerSocketFactory factory ) {
50
+ listenPort = port ;
51
+ this .factory = factory ;
52
+ start ();
53
+ }
54
+
38
55
public synchronized SocksServer start () {
39
56
stopped = false ;
40
57
new Thread (new ServerProcess (listenPort , factory , authenticator )).start ();
You can’t perform that action at this time.
0 commit comments