```export RABBITMQ_URL=guest:guest@localhost:15672...
# ktor
r
Copy code
export RABBITMQ_URL=guest:guest@localhost:15672
Copy code
val rabbitmqURL = System.getenv("RABBITMQ_URL")
    val url = URLBuilder()
    url.takeFrom(rabbitmqURL)
Gives me
Copy code
2024-03-15 13:11:55.989 [eventLoopGroupProxy-4-2]  TRACE i.k.client.plugins.HttpCallValidator - Processing exception java.net.ConnectException: Connection refused for request <guest://localhost/guest@localhost:15672/api/vhosts/eb1de2cd-f9bc-4d50-876f-28bb891da301>
So I have a feeling that
takeFrom
can't parse URLs fully?
a
Can you tell me what URL scheme is that?
r
http url with user/password
a
According to the specification, the URL should start with
//
then.
r
Changed that, doesn't seem to parse
user
correctly 😞
a
Can you please check the following code?
Copy code
val url = Url("//user:pass@localhost:15672/abc")
println(url.host)
println(url.port)
println(url.user)
println(url.password)
println(url.encodedPath)
r
The
URI
parser seems to work as it should, I'll go with that
2024-03-15 144546.959 [eventLoopGroupProxy-4-1] TRACE i.k.c.plugins.defaultTransformers - Transformed with default transformers response body for http://guest:guest@localhost:15672/api/vhosts/d8e989a9-0fae-4b3e-ad78-15bd67a80c55 to class io.ktor.utils.io.core.ByteReadPacket Looks good
Still looks good, but something's weird, it's not being accepted by the other side.
j
Hey @reactormonk! Are you using application.conf or yaml? I always leave information such as database variables and URLs in this file