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

dissolved girl

10/09/2023, 10:18 AM
Hi! How would one perform HTTP requests to a Unix socket instead of a TCP socket? I tried using
unix://
as the schema, but that didn't seem to work. I'm using the CIO client engine
h
d

dissolved girl

10/09/2023, 11:31 AM
That is a shame, but thanks for informing me
h

hfhbd

10/09/2023, 12:27 PM
At least for test purposes you could easily checkout my branch.
d

dissolved girl

10/09/2023, 12:29 PM
Thanks. I'll probably come up with some other alternative, ie a shim that listens on localhost on whatever port and forwards traffic between the socket and the application itself
Or maybe it's possible to provide CIO with a socket manually? If I build the socket using junixsocket, for example
I'm quite new to Kotlin (and Java), so apologies if I'm missing something too obvious
h

hfhbd

10/09/2023, 1:23 PM
Do you use Kotlin/JVM (Java)? If so, you could use a client engine which supports unix sockets, AFAIK netty support it.
d

dissolved girl

10/09/2023, 1:24 PM
Yes, I'm running on the JVM. I used CIO because it seemed to be the suggested one. I'll give Netty a try. Thanks!
Netty does not appear to work for Ktor Client
h

hfhbd

10/09/2023, 9:08 PM
Oh sorry, I mixed it up with Ktor Netty server side engine.
12 Views