NullOranje
I’m trying to setup a Vagrant box using generic/freebsd12 as the base image. I cannot get my Phoenix application to listen on IPv4 addresses inside the VM. It will respond to IPv6 as expected, so I know it works.
config :bison_app, BisonWeb.Endpoint,
http: [
port: String.to_integer(System.get_env("PORT") || "4000")
],
url: [host: System.get_env("HOST") || "app.local"],
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: secret_key_base
From inside the VM:
$ curl -4 localhost:4000
curl: (7) Failed to connect to localhost port 4000: Connection refused
$ curl -6 localhost:4000
<HTML response>
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
How Can I Optimise Compile Time Dependencies
I have been building an elixir application for about 2 years now. Many modules and files ha...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
jarmo
I have the same problem on FreeBSD 13.2. Same code/configuration listens on IPv4 on Ubuntu.
Did you solve it somehow in the end?
zaljir
Try adding the explicit IP to listen on? Not sure what the defaults are.
E.g.:
jarmo
Managed to solve it. I’m in the process of migrating from Ubuntu Linux to FreeBSD and for some reason on Ubuntu Linux Phoenix did bind to the IPv4, but using the same code and configuration on FreeBSD did bind only on IPv6.
I tried all tricks on changing
config/config.exs,config/prod.exsandconfig/prod.secret.exs, but it turned out that the problem was in thelib/my_app_web/endpoint.exwhere ininitfunction had the following line:Changing it to:
I’m pretty sure that this line has been on
inet6for the entire time of the project and it was generated byphx.newat the time of project creation. Just bear in mind that this is a legacy Phoenix application running version1.5.1and might not have the same generated file when creating a new Phoenix application today.bortzmeyer
On Linux, by default, an “inet6” socket also accepts IPv4 (you can disable that with the sysctl option net.ipv6.bindv6only or by adding
{ipv6_v6only: true}to your socket options). On FreeBSD, it is not the case by default. You can enable a similar behaviour by addingipv6_ipv4mapping=YESin/etc/rc.conf. See rc.conf(5)drfreeze
I’m on 14.1 and can’t get it to bind to tcp4.
$ doas netstat -an | grep LISTEN
tcp6 0 0 *.4000 . LISTEN
I have also set ipv4 mapping in rc.conf.
rc.conf
ipv6_ipv4mapping=“YES”
$ uname -a
FreeBSD learning01 14.1-RELEASE-p5 FreeBSD 14.1-RELEASE-p5 GENERIC amd64
Any ideas?
jarmo
This problem even persists on FreeBSD 14 when applying the changes in
endpoint.exas described above by me?