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

austin aigbe <>
Sun Mar 1 00:18:16 CET 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150301/36bdb373/attachment.html>


More information about the erlang-questions mailing list