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

Václav Škorpil

01/26/2022, 8:29 AM
Hi, do you know how to set up proxy with authentication for ktor client using CIO engine on jvm. In documentation there is only this and no further details. "Proxy authentication and authorization are engine specific and should be handled by the user manually."
a

Aleksei Tirman [JB]

01/26/2022, 10:58 AM
Could you please describe your problem in more detail?
v

Václav Škorpil

01/26/2022, 12:52 PM
Yes. I have ktor backend application that uses ktor client to fetch some data from internet. This application sits on a server behind proxy when deployed. The proxy requires atuhentication to connect to it. In ktro client there is no option for it. if i set the proxy in Linux
.bash_profile
it looks like this.
Copy code
export http_proxy="<http://accountname:password@192.17.14.77:8080>"
d

duuusha

01/26/2022, 3:06 PM
If proxy uses basic http authentication, you can add an authorization header https://ktor.io/docs/eap/proxy.html#proxy_auth
181 Views