java-socks-proxy-server
java-socks-proxy-server copied to clipboard
Extend Authentication Modes
I've been working on extending auth mode, to support dynamic username/password authentication, with some refactoring.
new SocksServer(determinePort(args))
.setAuthenticator(new UsernamePasswordAuthenticator(false) {
@Override
public boolean validate(String username, String password) {
return username.equals("mysecureusername") && password.equals("mysecurepassword");
}
}).start();
So far it is working good, I've tried with multiple clients.
This update modifies the constructors, to effectively pass configuration through constructors, rather than methods. So anyone after updating to this code, will have to do a small refactor.
Hey, thanks you so much for helping out!
This update modifies the constructors, to effectively pass configuration through constructors, rather than methods. So anyone after updating to this code, will have to do a small refactor.
Is this still the case? If so, can't you provide a default constructor for backwards compatibility?
Also, in the README changes, you removed the line of stopping servers. You also removed the examples for use in junit testing (although I admit I forgot to update this myself, when I switched to JUnit 5). And also, previously it was demonstrated in the documentation that you can start multiple listeners on different ports. I feel this point got lost in your version.
Is this still the case? If so, can't you provide a default constructor for backwards compatibility?
Hi yes, it is still the case, yes I can provide backwards compatibility, I'll update the code.
Also, in the README changes, you removed the line of stopping servers.
That's right, I'll add those lines.
You also removed the examples for use in junit testing (although I admit I forgot to update this myself, when I switched to JUnit 5).
I'm not exactly sure what I have to add, could you please help me out there?
And also, previously it was demonstrated in the documentation that you can start multiple listeners on different ports. I feel this point got lost in your version.
IMO, letting one single instance start multiple listeners on different port feels wrong. Each instance of SocksServer
should only effectively manage one server, along with customization to each individual server.
You also removed the examples for use in junit testing (although I admit I forgot to update this myself, when I switched to JUnit 5).
I'm not exactly sure what I have to add, could you please help me out there?
That's fine, I'll add the examples shortly.
And also, previously it was demonstrated in the documentation that you can start multiple listeners on different ports. I feel this point got lost in your version.
IMO, letting one single instance start multiple listeners on different port feels wrong. Each instance of
SocksServer
should only effectively manage one server, along with customization to each individual server.
Perhaps, but it is what it is; this is how the library works right now. I'll let the users decide how to use it, but I don't want to hide it by not documenting it.
Perhaps, but it is what it is; this is how the library works right now. I'll let the users decide how to use it, but I don't want to hide it by not documenting it.
Hmm, so are we keeping this version, or revert back to the old system where each instance can spawn multiple servers?
Perhaps, but it is what it is; this is how the library works right now. I'll let the users decide how to use it, but I don't want to hide it by not documenting it.
Hmm, so are we keeping this version, or revert back to the old system where each instance can spawn multiple servers?
Oh you changed it. I thought you only changed the documentation :D
Alright, I had a quick look. I'm fine with the change.
I'll edit the code for backwards compatibility, also resolve the conflict.
@bbottema can you please review? Can you also update the change history and the version?
Released in v4.1.0! Thanks again!