Is this library available for Cloudflare Workers?
CatAnonymous opened this issue · comments
Is there any way to run it on cf workers environment let me know. Thankyou!
cc @Finesse
You can't run the BotD code on a CloudFlare worker directly because it needs browser APIs to work. But you can make a worker inject the BotD JS script into the HTML code. There is no ready solution for CloudFlare workers, you need to make it yourself. An example strategy:
- Make the worker stand between the client side and your website. The worker must handle requests to and responses from your website.
- If a response is an HTML page, add
<script>
tags to it. The tags should download and execute BotD, and inject the result into HTML forms that you want to protect as<input type="hidden" ... >
tags. - When the worker handles a request to a protected form, it should check the input value, and block the request if necessary.
You can't run the BotD code on a CloudFlare worker directly because it needs browser APIs to work. But you can make a worker inject the BotD JS script into the HTML code. There is no ready solution for CloudFlare workers, you need to make it yourself. An example strategy:
- Make the worker stand between the client side and your website. The worker must handle requests to and responses from your website.
- If a response is an HTML page, add
<script>
tags to it. The tags should download and execute BotD, and inject the result into HTML forms that you want to protect as<input type="hidden" ... >
tags.- When the worker handles a request to a protected form, it should check the input value, and block the request if necessary.
Thankyou, using it on the frontend can be easily bypassed, it's not the solution I want, I'll look for another library