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

Arkangel

01/28/2021, 10:51 AM
Hey guys.. how can i get the remote address of a caller in ktor?
a

andylamax

01/28/2021, 10:58 AM
Copy code
val RequestConnectionPoint.url get() = "$scheme://$remoteHost:$port"

// then you can type
request.origin.url
👍 1
Don't know if that is what you are looking for
a

Arkangel

01/28/2021, 11:22 AM
Thanks .. that may work but Application.call doesn’t contain that
Copy code
call.request.origin.uri.???
a

andylamax

01/28/2021, 11:25 AM
Something like that
👍 1
a

Arkangel

01/28/2021, 11:25 AM
cools .but doesn’t have all the info.. but i’ll explore further.. thanks
a

andylamax

01/28/2021, 11:26 AM
call.request.origin.url
// not
origin.uri
Use the extension property provided
👍 1
2 Views