https://kotlinlang.org logo
Title
l

langara

05/22/2023, 9:33 AM
Can I somehow run ktor server app inside kotlin notebook (intellij managed kernel)? My first try gave me "Connection refused" (on localhost client).
i

Ilya Muradyan

05/22/2023, 9:47 AM
Hi! It should be possible, at least I know about successful attempts. We can take a look on the problems you have
l

langara

05/22/2023, 9:57 AM
Hi, maybe there is a configuration for jupyter kernels somewhere, so I could "allow" connections at least from localhost? I don't even know if my issue is related to the fact that it's intellij managed kernel (I never tried such things on any other jupyter kernels)
a

altavir

05/22/2023, 10:49 AM
Yes, you can. I showed it in some talks. Let me find an example
I have not tested it on Idea notebook though.
I just checked and it works as intended. You can try to use https://github.com/SciProgCentre/plotly.kt/blob/master/examples/notebooks/plotlykt-server-demo.ipynb. It uses ktor server inside to propagate changes to the plot.
l

langara

05/22/2023, 3:23 PM
Looks awesome. It worked in my Intellij notebook second time I tried. Also my own ktor server experiment is working now. I guess it's just that the kotlin-kernel isn't stable yet and sometimes needs restarting or sth. Or maybe I didn't clean up sth properly. Anyway generally I can confirm that ktor server inside intellij managed notebook is working.