nitrogen does not listen on ipv6 addresses
Reported by Fabian Linzberger | December 1st, 2009 @ 05:37 AM
i am running the default platform "inets".
in the default config nitrogen projects will only bind ipv4
addresses
for listening:
$ netstat -tln |grep 8000
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN
while I completely understand that ipv6 is not a top priority
for
development, this is annoying because the inets {bind_address,
any}
default would work just fine, as applying the following patch as
a
(crude) workaround immediately demonstrates:
diff --git a/src/platforms/nitrogen_inets_app.erl b/src/platforms/nitrogen_inets_app.erl
index d00b961..a00cc77 100644
--- a/src/platforms/nitrogen_inets_app.erl
+++ b/src/platforms/nitrogen_inets_app.erl
@@ -15,7 +15,7 @@ start() ->
{port, nitrogen:get_port()},
{document_root, nitrogen:get_wwwroot()},
{server_root, "."},
- {bind_address, nitrogen:get_ip()},
+ %%{bind_address, nitrogen:get_ip()},
{server_name, nitrogen:get_host()},
{modules, [wf_inets, mod_head, mod_get]},
{mime_types, [{"css", "text/css"}, {"js", "text/javascript"}, {"html", "text/html"}]}
$ netstat -tln |grep 8000
tcp6 0 0 :::8000 :::* LISTEN
at least for inets returning get_ip/0 in src/nitrogen.erl should
probably return
any as default case instead of {0.0.0.0}.
i will try to come up with a patch within the next days after
also
trying it out with mochiweb and yaws.
Comments and changes to this ticket
-
Fabian Linzberger December 1st, 2009 @ 11:22 AM
mochiweb also accepts any in exactly the same way as inets.
i am currently unable to get nitrogen to run with yaws, so i cannot really test it. judging from the source code further work will be necessary to avoid breaking stuff for yaws.
for inets and mochiweb the attached patch has been tested and solves the issue.
-
Rusty Klophaus April 13th, 2010 @ 09:29 PM
- State changed from new to resolved
- Assigned user set to Rusty Klophaus
Nitrogen 2.x allows you to use the mochiweb/inets/yaws configuration files directly, rather than Nitrogen getting in the way.
Try the latest release of Nitrogen (http://nitrogenproject.com/downloads):
- Build for your desired HTTP server by running make {rel_inets|rel_mochiweb|rel_yaws}
- This will build a standalone install of Nitrogen under rel/nitrogen.
- Then, see the config files in rel/nitrogen/etc
Please post a new bug if this is still a problem.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Nitrogen Web Framework for Erlang