Pure Elixir Tor client implementation
def deps do
[
{:garlic, "~> 0.1.0-dev", github: "abiko-search/garlic"}
]
end
alias Garlic.{CircuitManager, Mint.Client}
domain = "abikoifawyrftqivkhfxiwdjcdzybumpqrbowtudtwhrhpnykfonyzid.onion"
port = 80
with {:ok, pid} <- CircuitManager.get_circuit(domain) do
for {url, i} <- Enum.with_index(~w(/ /robots.txt /sitemap.xml)) do
Task.async fn ->
pid
|> Client.request(i + 1, domain, port, "GET", url, [], "")
|> Enum.join()
|> IO.inspect(label: url)
end
end
|> Task.await_many(:infinity)
end