https://kotlinlang.org logo
#ktor
Title
n

Nikky

07/17/2018, 10:44 AM
so i have a weird issue.. i am using ktor with tomcat and am running it with ./gradlew tomcatRun and i also have a nginx reverse proxy set up for ssl a single endpoint where i am building html and link to a stylesheet gives a empty response
d

Deactivated User

07/17/2018, 10:47 AM
Have you tried to run standalone instead of with tomcat? Since you have a nginx doing reverse-proxy you probably won’t need tomcat at all
n

Nikky

07/17/2018, 10:49 AM
actually everywhere where i use
call.respondHtml
breaks on me.. i just did not notice
d

Deactivated User

07/17/2018, 10:50 AM
do you have a stacktrace?
n

Nikky

07/17/2018, 10:50 AM
thats the thing its just a empty reponse and the server is not complaining at all
d

Deactivated User

07/17/2018, 10:50 AM
and I would try Netty if you can, since it is the most tested backend, to see if it works there and reduce the issue
n

Nikky

07/17/2018, 10:50 AM
i think it sends the data and the browser does not accept it
i will go back to standalone netty
d

Deactivated User

07/17/2018, 10:51 AM
well, try to curl/wget it to see the full response including headers
n

Nikky

07/17/2018, 10:54 AM
Copy code
⌁74% [nikky:~] % curl <https://curse.nikky.moe/api/widget/233564>     
curl: (52) Empty reply from server
okay so at least the brwoser did not lie to me
d

Deactivated User

07/17/2018, 10:54 AM
🙂
that’s with tomcat, right?
or with Netty?
n

Nikky

07/17/2018, 11:04 AM
that was still using tomcat
now i am trying to get tomcat to shut down on my dev laptop so i can test if netty will work
👌 1
the damn thing just hogs the port.. kill -9 it is then
so yes it works in netty
and in tomcat all html builder responses are just empty
d

Deactivated User

07/17/2018, 11:15 AM
other responses work fine?
n

Nikky

07/17/2018, 11:16 AM
other reponses i use are redirect and JSON
and they work
well i use this a lot
ApplicationCall.respond(message: Any)
d

Deactivated User

07/17/2018, 11:17 AM
and that one works fine?
So maybe it is an issue with tomcat + respondText with writter?
does it fail without nginx as reverse proxy?
though it should because nginx acts as a normal http client
n

Nikky

07/17/2018, 11:18 AM
it seems to work fine.. there was one stacktrace like that but it was in my idea run dialog and i forgot to save it.. cannot reproduce either
it does not fail when i connect directly to :8080 using tomcat
i first suspected i hat the ports set up incorrectly or so.. but it seems to work fine with netty
d

Deactivated User

07/17/2018, 11:20 AM
uhm, that’s strange then
n

Nikky

07/17/2018, 11:22 AM
i am using stylesheetLink in my html builder code .. so i thought it might just try to use a css thats on a different port and my browser complains.. but thats not what happened.. there was no response at all and no errors being logged for it
and not all my html builders had stylesheets either
in my code it errors on
Copy code
> call.respondHtml {
   widget(id, version)
}
that is with
tomcatRunWar
d

Deactivated User

07/17/2018, 11:43 AM
Nice. Can you create a bug report at github?
n

Nikky

07/17/2018, 12:57 PM
d

Deactivated User

07/17/2018, 12:57 PM
thanks!
5 Views