How to create an ArchLinux bootable USB for AsahiLinux for M1/M2 Macs.
Hackney is the adapter behind HTTPoison and Hackney, because it is awesome, offering features such as HTTP Keepalive, SSL support, pools and it’s battle tested and stable.
One of the experiments I recently tried was how to use a HTTP Proxy (NordVPN offers a http proxy as part of their package) with it.
You can easily do this by passing in proxy and proxy_auth.
Using plain ol’ hackney: options = [ proxy: {'au1111.
[error] GenServer :tzdata_release_updater terminating ** (ArgumentError) argument error (stdlib) :ets.lookup_element(:hackney_config, :mod_metrics, 2) You hate to see it when running iex -S mix locally, basically it’s an issue where tzdata can’t update.
You can fix this by either:
Adding the following to your projects dev config:
config :tzdata, :autoupdate, :disabled
Adding the following snippet to your .iex.exs file:
Application.put_env(:tzdata, :autoupdate, :disabled)
You can read more about this on the tzdata README.
Using IEx with a remote API with HTTPoison, it can be handy to show int he console the request and response you get back with hackney.
You can do this by entering the following in iex:
:hackney_trace.enable(:max, :io) You can also add this to .iex.exs file so it’ll always be added to your iex sessions by default so you don’t need to always retype it when needed.
This will give you an output like this:
So you have setup your API to accept CORS requests on certain paths on your API using cors_plug or corsica and you are wondering how you test this with ExUnit.
Back to basics: Does the endpoint actually work? Well the first thing to do is to check if your endpoint is actually working with CORS.
You can do this via cURL:
curl http://localhost:4000/api/posts -v -H "Origin: https://example.com" You will need to change the URL to your API Endpoint and your Origin to the URL you have allowed to access this endpoint.