Archive

Archive for November, 2022

Runing Hosted CapMonster Locally in C#

If you use CapMonster Cloud, then you may find that the per-request pricing does add up over high volumes, if you have spare computing power, then you can run CapMonster Hosted on your own server., or if you are running a batch-process on your own local PC, then this could be a big cost saver.

It’s not free, since you need to buy a license from CapMonster for the base sofware, I used the Lite version for $37, available here: https://zennolab.com/en/products/capmonster/#section_price – Then you also need the sitekey add on, which is $10 per month, available here; https://zennolab.com/wiki/en:addons:capmonster:sitekey – But this now allows you solve 100,000 captchas per day, instead of the $0.6 * 100 = $60 per day cost of the equivalent on CapMonster Cloud at the same volume.

So, After downloading the required software, it will start a server on 127.0.0.3 (port 80) by default that exposes the same API as capmonster.cloud – but obviously with a differnt endpoint (local vs remote).

The problem is that if you use the NuGet Package here; https://www.nuget.org/packages/CapMonsterCloud then you will notice that this does not offer the API endpoint to be configurable.

What I did was clone the repo from https://github.com/mboukhlouf/CapMonsterCloud and then set then change the ApiBaseUrl specified in Endpoints.cs – or make it a public property, and modify it in your client code.

So, this could be a good cost saving tip, for heavy users of CapMonster.

Advertisement
Categories: Uncategorized

Using AWS CloudFront as a proxy

Typically, CloudFront is used to serve your own website, so that it can leverage AWS’s CDN, and various edge servers in many countries, so that data is not transferred accross the world with every HTTP request.

But, you can also use it as a proxy, by pointing CloudFront at someone else’s website. This means that when you visit the CloudFront URL, the request to the third party website will come from AWS rather than from your local machine.

It’s not as anonymous as a good proxy, since there are various headers that would undoubtedly expose you, based on the request made to HTTPBIN below;

{
  "args": {}, 
  "headers": {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 
    "Accept-Encoding": "gzip, deflate, br", 
    "Accept-Language": "en-US,en;q=0.9", 
    "Dnt": "1", 
    "Host": "httpbin.org", 
    "Sec-Ch-Ua": "\"Google Chrome\";v=\"107\", \"Chromium\";v=\"107\", \"Not=A?Brand\";v=\"24\"", 
    "Sec-Ch-Ua-Mobile": "?0", 
    "Sec-Ch-Ua-Platform": "\"Windows\"", 
    "Sec-Fetch-Dest": "document", 
    "Sec-Fetch-Mode": "navigate", 
    "Sec-Fetch-Site": "none", 
    "Sec-Fetch-User": "?1", 
    "Upgrade-Insecure-Requests": "1", 
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", 
    "X-Amzn-Trace-Id": "Root=1-636908d7-xxxxxxxx"
  }, 
  "origin": "xxx.xxx.xxx.xxx", 
  "url": "https://httpbin.org/get"
}

Here X-Amzn-Trace-Id could probably be tied to you.

Categories: Uncategorized
%d bloggers like this: