https://kotlinlang.org logo
Title
m

marstran

05/25/2021, 11:00 AM
Hi, Has anyone tried to run Ktor with embedded Jetty as an AppService in Azure? I'm able to get the app running (the logs says it started correctly), but I am unable to reach it. I am just getting a timeout. Not really sure if it's actually a Ktor-problem, but I tried to deploy the spring-boot example to the same app service, and that worked fine.
d

darkmoon_uk

05/25/2021, 12:08 PM
Maybe not relevant; but does your App use websockets? I just encountered the fact that Websockets don't work from a WAR deployed in Jetty at all. The code I'm using matches the Ktor examples and works perfectly when run from
main()
or as a WAR from Tomcat; so it appears Ktor/Jetty Compatibility is broken in some way.
m

marstran

05/25/2021, 2:11 PM
It was just a simple HTTP-endpoint. No websockets. However, I was just able to find the issue. I was listening to the wrong port -_- I had to read the correct port from the environment. Turns out when you run the app on a Windows-server, it sets a special "SERVER_PORT"-variable.
That variable isn't documented anywhere as far as I can see. I just found someone with the same issue here: https://stackoverflow.com/a/67318907/4137489