SWI-Prolog/swish

Server only serves localhost

Closed this issue · 3 comments

Per documentation

% Using localhost:Port, we only bind to localhost interface!
% Use plain 3050 (or any port number you like) to make the server
% accessible from all network interfaces.

But actually does

run_swish :-
set_prolog_flag(toplevel_goal, prolog), % run interactively
current_prolog_flag(argv, Argv),
argv_options(Argv, _, Options),
option(port(Port), Options, 3050),
server(localhost:Port). <-- always forces localhost only

So how is one to start the server so it's accessible other than from localhost?

If you want anything complicated use the daemon.pl script. That provides zillions of options. In your case this probably does what you want:

swipl daemon.pl --port=3050 --interactive

thanks.

My fault, inspected daemon.pl but didn't figure out it was passing relevant options down.

Closing