Open jmaslak opened 1 year ago
FWIW, I'm working around this by swapping out the listener in the service object with one that lets me get the port number. But using Cro this way feels...really wrong. :)
See example: https://gist.github.com/jmaslak/ba3cbfe1abd13b76ac906cfaeb0f62e9
It would be amazing if there was a way you could get the port number Cro listens at when you pass it a "0" for the port number. This would let Cro bind to a free port, which could be very useful in test harnesses, as hardcoding a port in the test harness is not guaranteed to be free from collisions. However, today there is no way that I know of to determine the port number it binds to if using a dynamic port, at least not in a portable way.