I would like to restrict access to my site based on the IP address of the client. For example, if an user’s IP address has had past transgressions on my site, I want to effectively block it.
I know how to access the IP address in Meteor Methods (ip = this.connection.clientAddress;), but now I want to know how I can block it from access.
// Server.js
Meteor.onConnection(function (connection) {
// Check if connected client has their IP banned
if (BannedIPs.findOne({IP: connection.clientAddress})) {
// Close/deny connection
connection.close();
}
})
I know I’m a bit late to a party.
But here are my 2 cents.
Looks like when Dpp is disconnected it immediately tries to connect.
So client will try to connect indefinitely.