[erlang-questions] Unable to access my inets http server from my phone or external PC

austin aigbe eshikafe@REDACTED
Sun Mar 1 02:54:57 CET 2015


Still the same experience. I still can't connect.
What could be wrong?

python -m SimpleHTTPServer works well and this implies it's not my network
configuration but an application issue. In this case my web_server.erl
application. So what am I doing incorrectly?

On Sun, Mar 1, 2015 at 1:26 AM, Leonard Boyce <leonard.boyce@REDACTED>
wrote:

> Removing the bind_address or set it to a non-localhost IP which is bound
> to your machine should sort it out.
>
> Leonard
> On Feb 28, 2015 6:19 PM, "austin aigbe" <eshikafe@REDACTED> wrote:
>
>> Hi,
>>
>> 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
>>
>> However, I am able to access the python based simpleHTTPServer from my
>> Android phone (using http://<PC IP address>:8000) via WiFi.
>>
>> How do I make my erlang inets server accessible from an external PC or
>> phone?
>>
>> OS: Windows 7
>>
>> %-----------------------
>> % web_server.erl
>> %-------------------------
>> -module(web_server).
>> -export([start/0, stop/0]).
>>
>> -define(PORT, 8000).
>> -define(SERVER_NAME, "server1").
>> -define(ROOT,"C:/Users/eausaig/Desktop/web_server").
>>
>> start() ->
>> {ok, _} = inets:start(httpd,
>> [{port, ?PORT},
>>  {server_name,?SERVER_NAME},
>>  {server_root,?ROOT},
>>  {document_root,?ROOT},
>>  {bind_address,{127,0,0,1}},
>>  {directory_index,["index.html"]},
>>  {server_tokens, full}]).
>>
>> stop() ->
>> [{_,_},{_,P2}] = inets:services(),
>> ok = inets:stop(httpd, P2).
>>
>> BR,
>> Austin
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150301/2ea243ee/attachment.htm>


More information about the erlang-questions mailing list