Closed pedrogpimenta closed 2 years ago
Client IP isn't included in the request object. If you need it, it's probably possible to modify the creation of the request object to include it. However, if you're just trying to know if someone else visits, I'd recommend looking at the certificate or fingerprint, which are included in the request object.
@jgkaplan OK I can filter myself out of the logs by using a certificate, that'll do it for me, thanks!
And only for learning purposes, when you say
modify the creation of the request object to include [IP adress]
you mean on the server code base, not something I can do on my end, right?
I did mean on the server code base (which you could technically fork and modify), although on further thought, the listen
method returns a tls.Server
. It might be possible to hook into it somehow from your end.
@jgkaplan Oh that's great! Yeah, just wanted to know, thanks! I'll close this now.
(I'm sorry if this is not the place)
I'm curious to see if anyone visits and what they do on my capsule :)
I didn't find any built-in logging, so I'm doing my own on each request. I'm fine with not having it but would like to know if there's any way to get the IP address of each request, so I can see if someone else visits, not just me reviewing changes!
I have logged the
req
object but nothing like that appears to exist.Is there any way to do this?
Thanks!