IP Authentication
Does simple-socks support IP Authentication (IP White Listing) ?
https://github.com/brozeph/simple-socks/blob/master/examples/createServerConnectionFilter.js#L6
The example above is for whitelisting, but with a dns lookup of hostname based on the value of address. Would the address value work for you if you’re looking to whitelist on IP specifically?
@brozeph
I'm trying to authenticate proxy users based on originating IP address.
the above sample filters based on destination host.
@mehdyhaghy, thank you for clarifying! There is an ability to get the originating socket via the handshake event: https://github.com/brozeph/simple-socks#handshake
You could perform a check at that point and close the socket... but this isn't quite elegant. I feel like the right path is to extend the connectionFilter and support both origin and destination filtering.
Also, worth noting, the socket for the origin (client) connection is provided in the connectionFilter event in v1.0.4 and earlier. Again, this isn't as elegant or consistent with the destination portion of the API... revising in v2.0.0.
@mehdyhaghy - I've updated the connectionFilter in v2.0.0 to make it a lot more straightforward to access the origin and destination for filtering purposes: https://github.com/brozeph/simple-socks#connectionfilter