brozeph / simple-socks

Simple SOCKS5 proxy server
281 stars 59 forks source link

Allow connection filtering #20

Closed slava-vishnyakov closed 6 years ago

slava-vishnyakov commented 6 years ago

This adds a allow_connection function to options, you can return true or false on whether you want to allow the connection to go through or not.

Thanks for the awesome app!

brozeph commented 6 years ago

@slava-vishnyakov - this is similar to #19 by @jfowl, but provides a different way to solve the need (host filtering). I intended to merge #19, but I haven't gotten to that yet because the code changes looked larger than they actually are due to converting tabs to spaces. After reading both, I'm more aligned to your approach.

Side note: I know that my choice of using tabs is totally not aligned with standard Node coding practices... Tabs vs Spaces)

slava-vishnyakov commented 6 years ago

Oops, right, haven't noticed tabs :)

Converted my code to tabs to have the same code style.

Yeah, it's totally minor decision - whatever works is good :)

jfowl commented 6 years ago

I totally agree with @brozeph, @slava-vishnyakov's approach is way more elegant! Since I was just re-opening the project on my workstation today (due to the Telegram blocking in Russia), I would love to see his changes merged asap.

brozeph commented 6 years ago

@jfowl @slava-vishnyakov - I have a few spare moments today to look at this again. I'll merge, touch a few things up to prepare a release and push shortly.

slava-vishnyakov commented 6 years ago

@brozeph Awesome 👍 Thanks!