A DNS over HTTPS (DoH) client written in elixir.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dough/lib/dough.ex

50 lines
1.2 KiB

6 years ago
defmodule Dough do
@moduledoc false
use Application
import Supervisor.Spec
import Cachex.Spec
import Logger
6 years ago
def start(_type, _args) do
children = [
worker(Cachex, [
:dough,
[
expiration:
expiration(
default: :timer.seconds(6000),
interval: :timer.seconds(300),
lazy: true
)
]
]),
{Plug.Adapters.Cowboy2,
scheme: :https,
plug: Dough.Router,
options: [
port: 8331,
otp_app: :dough,
keyfile: "priv/ssl/localhost.key",
certfile: "priv/ssl/localhost.crt"
]}
6 years ago
]
Logger.info("
Starting Dough Server #{Application.get_env(:dough, :current_version)} ...
DNS Proxying to #{Application.get_env(:dough, :dns_server)}
")
6 years ago
opts = [strategy: :one_for_one, name: Dough.Supervisor]
Supervisor.start_link(children, opts)
end
end