2

I know about: https://check.torproject.org/

It uses HTML which can change at any moment, and is intended for humans.

I'm looking for some URL (or other method) which wastes as little resources as possible to tell me whether the connection is going over Tor or not, for the purpose of auto-verifying that "Tor is still running/working". Something which just returns a minimal JSON blob or even just a "0" or "1" would be ideal.

Is there such a thing?

2

Why do you think it would change at any moment? I'm too searching for short/comfortable json-like-way. But, for the first time, I do not think that plain/html - is high-resources or would be changed too often or smthng...

https://check.torproject.org/ contains very clean text, if you are using tor:

<h1 class="not">

      Congratulations. This browser is configured to use Tor.

  </h1>

So, even simple bash script could give you 0/1 as out:

#/bin/bash
url="https://check.torproject.org/"
pattern="Congratulations. This browser is configured to use Tor."

result="$(torsocks wget -O - "${url}" 2>&1 | grep "${pattern}")"

[ ! -z "${result}" ] && echo 1 || echo 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.