> For the complete documentation index, see [llms.txt](https://ipforensics.gitbook.io/ipforensics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ipforensics.gitbook.io/ipforensics/code-implantation/block-vpn-proxy-and-tor-users.md).

# Block VPN/Proxy and Tor users

This code example shows you how you might protect your app from free trial abuse or from users trying to get around country restrictions by using Tor or Proxies.

```javascript
// Getting the anonymity status from the user's IP
$.get("https://ipforensics.net/api/v1/origin?apikey=APIKEY", function (response) {
  if (response.meta_data.threat_detector.is_anonymous) {
    alert("You are not allowed to create an account.");
    }
}, "jsonp");
```

This simple example shows **"You are not allowed to create an account."** if `is_anonymous` is true . You can replace it with more complex handling such as preventing the user from signing up or requiring a credit card.\
You might also choose to allow Tor users through and only block users using proxies.

```javascript
// Getting the anonymity status from the user's IP
$.get("https://ipforensics.net/api/v1/origin?apikey=APIKEY", function (response) {
  if (response.meta_data.threat_detector.is_proxy) {
    alert("You are not allowed to create an account.");
    }
}, "jsonp");
```

You also have the option of blocking users whose IP's have been reported repeatedly by admins across the internet for malicious activity or spam. To do this simply block if the following fields are true;

* `is_known_abuser` - to block IPs that have been reported to be sources of spam
* `is_known_attacker` - to block IPs that have been reported to be the source of malicious activity

We aggregate and regularly update our lists from high quality, authoritative sources to develop our dataset of more than 600M malicious IP Addresses, spammers, open proxies and Tor exit nodes

{% hint style="success" %}
**Always reference the** [**API endpoint**](/ipforensics/api/ip-and-threat-intelligence-api.md) **for complete response result**
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ipforensics.gitbook.io/ipforensics/code-implantation/block-vpn-proxy-and-tor-users.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
