bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)
http://www.simplejavamail.org
Apache License 2.0
1.23k stars 270 forks source link

[enhancement] Add getter for Authenticated SOCKS server port #563

Closed varyoo closed 6 days ago

varyoo commented 1 week ago

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.

varyoo commented 6 days ago

Thanks, is a new release planned?

bbottema commented 6 days ago

Released in 8.12.3!