Skip to content

Conversation

2buisson
Copy link
Contributor

It is already possible to let the OS allocate an ephemeral port when starting the SOCKS proxy server with port = 0.

This very simple PR allows to retrieve the allocated port after the server is started by introducing a getter :

AnonymousSocks5Server s = new AnonymousSocks5ServerImpl(new AuthenticatingSocks5Bridge(socksProxyConfig), 0);
// Get SOCKS server port
int port = s.getLocalPort();

So it can be used in other projects.

@bbottema bbottema merged commit 2ab2e71 into bbottema:master Nov 25, 2024
1 check passed
@2buisson
Copy link
Contributor Author

Thanks, is a new release planned?

@bbottema bbottema added this to the 8.12.3 milestone Nov 25, 2024
@bbottema bbottema changed the title [Authenticated SOCKS module] Let the OS allocate an ephemeral port [Authenticated SOCKS module] Add getter for server port Nov 25, 2024
@bbottema bbottema changed the title [Authenticated SOCKS module] Add getter for server port [enhancement] Add getter for Authenticated SOCKS server port Nov 25, 2024
@bbottema
Copy link
Owner

Released in 8.12.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants