sezaru
Can't access fly.io app via flycast from Elixir (but can from curl)
I have a app in Fly.io called skip-trace-proxy with a squid HTTP proxy running. That app is deployed with flycast meaning that I should be able to access it from other apps in the same org by calling skip-trace-proxy.flycast as the URL.
If I try doing that using curl like this:
curl -x skip-trace-proxy.flycast:3128 ifconfig.co
It works great, but, when I try using Req or Finch to call it, I get a nxdomain error:
> Req.get!("http://skip-trace-proxy.flycast:3128")
** (Req.TransportError) non-existing domain
(req 0.5.14) lib/req.ex:1121: Req.request!/2
iex:3: (file)
> Req.get!(
"https://fly.io",
connect_options: [proxy: {:http, "skip-trace-proxy.flycast", 3128, []}]
)
** (Req.TransportError) non-existing domain
(req 0.5.14) lib/req.ex:1121: Req.request!/2
iex:1: (file)
# FinchConfig:
# {Finch, name: Core.ProxiedFinch, pools: %{
# default: [
# protocols: [:http1],
# conn_opts: [
# proxy: {:http, "skip-trace-proxy.flycast", 3128, []}
# ]
# ]
# }},
> Finch.build(:get, "http://ifconfig.co") |> Finch.request(Core.ProxiedFinch)
{:error, %Mint.TransportError{reason: :nxdomain}}
Why is this happening?
It seems like the issue is because the flycast will be using ipv6 only, so, for a url you would enabled inet6: true, but I can’t figure out how to configure the same for the proxy to use ipv6 too.
Marked As Solved
sezaru
After trying some options I found the solution, you need to setup the proxy this way:
Req.get!(
"http://ifconfig.co",
connect_options: [
proxy: {:http, "skip-trace-proxy.flycast", 3128, [transport_opts: [inet6: true]]},
]
)
3
Popular in Questions
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
15:22:35.803 [error] gen_event {lager_file_backend...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
For example for a current url like
http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2,
I would like to get:
...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Hi,
I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
Hi all,
Trying to get some more clarity over utc_datetime and naive_datetime for Ecto:
The documentation above suggests that while ...
New
I would like to know what is the best IDE for elixir development?
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
Other popular topics
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
Hi!
In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir?
Searched the docs for ip address and the web, no good results.
Thanks!
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Lets say I have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









