On Mon, 2018-06-04 at 09:49 +0200, Reinert Korsnes wrote:
> Hi,
> 
> I try to learn to use gnoga.
> 
> I installed gnoga on a remote raspberry pi (Rasbian/Stretch), A, and 
> tried to get "Hello World" in a browser on my local computer B (I 
> generally use this raspberry pi (A) as a web server (Apache) in my
> local 
> network).
> 
> I did not manage to make this function.
> 
> However, I manage to run "Hello World" on my local computer B. I
> provide 
> a copy of the actual gnoga demo program below where I did comment
> out 
> the statement:
> 
> Gnoga.Application.Open_URL ("http://127.0.0.1:8080";);
> 
> Then I can open the address "localhost:8080" in a browser (locally
> on 
> computer B) and get "Hello World" in it.

Same example should work. You need to ascertain the IP address of your
server (the R-Pi) on your local network (like 192.168.254.16 for mine)
and open 192.168.254.16:8080 from another local device.

(If it doesn't work, you need to configure the R-Pi's firewall to make
that port visible to the local network)

-- Brian

> 
> But how to do this when the "Hello World" program runs on my remote 
> raspberry pi (A)? Has someone ready a "Hello World" program for this?
> 
> Best regards, Reinert
> 
> ------------------------------------------------------------------
> 
> with Ada.Exceptions;
> with Gnoga.Application.Singleton;
> with Gnoga.Gui.Window;
> with Gnoga.Gui.View.Console;
> 
> procedure hello is
>     Main_Window : Gnoga.Gui.Window.Window_Type;
>     Main_View   : Gnoga.Gui.View.Console.Console_View_Type;
> begin
>     Gnoga.Application.Title ("hello");
>     Gnoga.Application.HTML_On_Close
>       ("<b>Connection to Application has been terminated</b>");
> 
> -- Gnoga.Application.Open_URL ("http://127.0.0.1:8080";);
>     Gnoga.Application.Singleton.Initialize (Main_Window, Port =>
> 8080);
> 
>     Main_View.Create (Main_Window);
>     Main_View.Put_Line ("Hello World!");
> 
>     Gnoga.Application.Singleton.Message_Loop;
> exception
>     when E : others =>
>        Gnoga.Log (Ada.Exceptions.Exception_Name (E) & " - " &
>                     Ada.Exceptions.Exception_Message (E));
> end hello;
> 
> 
> -------------------------------------------------------------------
> -----------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gnoga-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gnoga-list

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to