0

I am making an Android application in Java. There is an onion Url that I want to check is live or not. Basically, Onion Url is mapped to an IP-address, so is there any Java library or API that can assist in determining this check? Any help in this regard will be appreciated. Thanks.

Anton Kazakov
  • 2,740
  • 3
  • 23
  • 34
Johnny
  • 1,743
  • 2
  • 10
  • 12

1 Answers1

0

You need to have a server on which the tor will work and already give from it either the desired status or the page that you need. For the site tor-sites.link we did the proxying of the tor through the tor launched into the container and the express.js server. You can see how it works at previewer. Schematically, it looks like this:

  1. HTTP request
  2. express.js server
  3. request to tor
  4. returning a response to the client

This way you can get data from the onino site.

Dockerfile:

FROM node:slim

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

RUN apt-get update && apt-get install gnupg wget -y && \
  wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
  sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
  apt-get update && \
  apt-get install google-chrome-stable -y --no-install-recommends && \
  apt-get install tor -y --no-install-recommends && \
  apt-get install torsocks -y --no-install-recommends && \
  apt-get install curl gnupg && \
  rm -rf /var/lib/apt/lists/*


WORKDIR /usr/src/app

RUN mkdir src
RUN mkdir tmp
COPY ./src ./src
COPY ./package.json \
     ./ecosystem.config.js \
     ./tsconfig.json \
     ./

RUN npm i -g pm2 npm@9.2.0
RUN yarn && yarn build

RUN rm -rf src


#HEALTHCHECK --start-period=150s --interval=300s --retries=99999 --timeout=120s CMD curl --fail http://localhost:3000/healthcheck || kill 1


EXPOSE 3000

CMD ["pm2-runtime", "start", "ecosystem.config.js"]
VINET
  • 641
  • 1
  • 7
  • 28