Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
116 views
in Technique[技术] by (71.8m points)

How do I get the server ip/port for a ktor service?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...