I am trying to migrate `plotly.kt` to newer ktor v...
# ktor
a
I am trying to migrate
plotly.kt
to newer ktor version and encountered a problem. I need to get a host name from request in order to send a data request to the same server but with different address. Previously I was using
call.request.host()
for that, but now for some reason on localhost it returns IP6 adress 0.0.0.0.0.0.0.0, which is not friendly with JS backward requests. Are there any better way to treat this situation?
c
Looks like it points to local address, you need an origin host,
call.rrquest.origin.host
a
call.request.host() is just a shortcut for what you wrote
c
Note that it doesn't include port
a
And I know about the port. Port is OK. I just found there is a change in behavior. It was working before.
I probably do not need the host address at all, since I am running everything inside the server, but I probably will need it in future.
c
Well, looks like we have it broken by pr
Use host header for now
When running behind a proxy, the forward headers feature should fix that as wll
a
Thanks, did not think about that.
c
Btw, it's strange that you see zeroes, not something like ::1
s
Note that nginx will not forward that by default in some configurations.
a
🤷‍♂️
plotly.kt is made for local visualization on the same machine, so in most cases it will use a localhost.
c
There are two headers that proxies usually set, we have two features for that
Ok
Could you please open an issue?
a
OK, I will, but I am not sure what is the designed behavior.