IP Access Rules #3437

rodrigoabbas opened this Issue Feb 14, 2017 · 4 comments


None yet

2 participants


Hi guys! Excelent work!

I was wondered if there is a way to permit/deny certain IP adresses for access control?
I want to do a whitelist on my node server.


@Marsup Marsup self-assigned this Feb 14, 2017
Marsup commented Feb 14, 2017


There doesn't seem to be any existing plugin doing that but it shouldn't be that hard, just filter the requests using onRequest.
Also, I don't mean to be rude, but the text you erased before posting your issue was specifically advising you to ask this type of question on the discuss repo, so next time please do.

@Marsup Marsup closed this Feb 14, 2017

I am really sorry @Marsup. I have been looking and googling this since 3 days, with no answer, and i wanted to post it as a last resource, so i barely read that text (really my bad!).
I am thankfull with your fast, polite and helpful response!
I will do that you suggest.

Marsup commented Feb 14, 2017

You can get inspiration from https://github.com/fs-opensource/hapi-geo-locate/blob/5f3f4461af3e69c4259ff3eb4f7dc4090d25d702/lib/index.js#L22-L29 as to how to get the IP. The method for rejecting IPs is yours to decide.


Excellent! Thank you very much for your help!! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment