I'm looking to write a Ktor feature that should announce the service on a local network using DNS-SD/mDNS. I would like to be able to automatically start the announcing on ktor application start and stop it on ktor application stopped. I've written code that does this using ApplicationStarted
and ApplicationStopped
event. This code works.
However, I can find no way of getting what IP address/port from ktor other than reading the configuration.
Is there any way of listening for/listing the connectors that ktor is currently using?
question from:
https://stackoverflow.com/questions/66064880/how-do-i-get-the-server-ip-port-for-a-ktor-service 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…