<p dir="ltr">Removing the bind_address or set it to a non-localhost IP which is bound to your machine should sort it out.</p>
<p dir="ltr">Leonard</p>
<div class="gmail_quote">On Feb 28, 2015 6:19 PM, "austin aigbe" <<a href="mailto:eshikafe@gmail.com">eshikafe@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I can't seem to access the erlang inets http server (web_server.erl) from my Android phone (using http://<PC IP address>:8000) via WiFi</div><div><br></div><div>However, I am able to access the python based simpleHTTPServer from my Android phone (using http://<PC IP address>:8000) via WiFi.<br><div><br></div><div>How do I make my erlang inets server accessible from an external PC or phone?</div><div><br></div><div>OS: Windows 7</div><div><br></div><div>%-----------------------</div><div>% web_server.erl</div><div>%-------------------------</div><div><div>-module(web_server).</div><div>-export([start/0, stop/0]).</div><div><br></div><div>-define(PORT, 8000).</div><div>-define(SERVER_NAME, "server1").</div><div>-define(ROOT,"C:/Users/eausaig/Desktop/web_server").</div><div><br></div><div>start() -></div><div>{ok, _} = inets:start(httpd, </div><div><span style="white-space:pre-wrap"> </span>[{port, ?PORT},</div><div><span style="white-space:pre-wrap"> </span> {server_name,?SERVER_NAME}, </div><div><span style="white-space:pre-wrap"> </span> {server_root,?ROOT},</div><div><span style="white-space:pre-wrap"> </span> {document_root,?ROOT},</div><div><span style="white-space:pre-wrap"> </span> {bind_address,{127,0,0,1}},</div><div><span style="white-space:pre-wrap"> </span> {directory_index,["index.html"]},</div><div><span style="white-space:pre-wrap"> </span> {server_tokens, full}]).</div><div><br></div><div>stop() -></div><div><span style="white-space:pre-wrap"> </span>[{_,_},{_,P2}] = inets:services(),</div><div><span style="white-space:pre-wrap"> </span>ok = inets:stop(httpd, P2).</div></div><div><br></div></div><div>BR,</div><div>Austin</div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div>