Fork me on GitHub
#yada
<
2017-01-18
>
lmergen14:01:45

given that it can be a bit tricky to properly determine what the "real" remote ip of the client is, does yada provide a mechanism for this ? there is of course :request :remote-addr, but then also the x-forwarded-for headers, which can in turn contain multiple ip addresses separated by a comma

danielcompton19:01:34

You always want to count from the end of the remote-addr list, not the front

danielcompton19:01:46

as the client controls what gets put on the front

danielcompton19:01:05

depending on how many layers of proxies you have you slice the last or second to last off

danielcompton19:01:16

(as you probably are already aware)

malcolmsparks19:01:15

@lmergen yes, there is an interceptor that determines the correct one and fishes it out into the ctx. Of course, the entire Ring request is available as :request in ctx so you can use Ring middleware too

lmergen21:01:59

ah where can i find that interceptor ? I tried searching a bit through the repo but couldnt find anything useful

limist21:01:43

noob question please: I'm attempting to add yada to an existing project, with a simple test route. Whether with bidi or compojure, I'm seeing an error when compiling:

java.lang.ClassNotFoundException: io.netty.channel.epoll.Epoll, compiling:(aleph/netty.clj:1:1)
...
From what I can see, aleph and netty jars/packages were pulled in OK when yada 1.2.0 was added. Any suggestions?

dominicm21:01:20

@limist you're getting the wrong version of netty I think. You've probably got dependency conflicts.

dominicm21:01:10

@limist https://github.com/technomancy/leiningen/issues/1055 This came up on Google, on mobile else I'd type up most of it :)