Page 1 of 1

NeoBook as CGI program?

PostPosted: Thu Jun 01, 2017 4:01 pm
by David de Argentina
Hi overthere,

I think this scenario:

* Your domestic pc has a dynamic IP
* You did not installed a web server in this pc.
* You would like run several NeoBook programs from another computers (or phones)

Long time ago, i found a Powerbasic program with a minimal version of a webserver (all we need in 44 kb!!!).
When running, the path of the program is the root of the server

I tested this trying to run a NeoBook program, like a CGI one.
Obviously, the NeoBook program is non-interactive, because it runs into the server (bah, your machine...)

In this sample, i read a recordset from a sqlite database (could be anything any idea) and response from the webserver the recordset.

the result image (from my phone, running Mozilla Firefox) is:

Image

If you wanna more info, tell me about this.

My 0.01
David de Argentina

Re: NeoBook as CGI program?

PostPosted: Fri Jun 02, 2017 8:44 am
by David de Argentina
Same program using the external IP and Opera Browser on my Phone (Android):

Image

Another 0.01
David de Argentina

Re: NeoBook as CGI program?

PostPosted: Fri Jun 02, 2017 3:36 pm
by David de Argentina
Hi overthere,

An user told me the previous images are not showing.

I just moved them to another server.

Could any tell me if the images are now visible ?

Thanks in advance,
David de Argentina

Re: NeoBook as CGI program?

PostPosted: Fri Jun 02, 2017 10:05 pm
by HPW
Yes, now visible.

Re: NeoBook as CGI program?

PostPosted: Sat Jun 03, 2017 7:24 pm
by virger
Tienes el '.bas' o bien el '.exe' de esa app?. Me interesaria una copia. Muy agradecido.
Do you have the '.bas' or '.exe' for that app? I'd be interested in a copy. Very thankful.

KEYLOR NAVAS es de COSTA RICA

Re: NeoBook as CGI program?

PostPosted: Thu Jun 08, 2017 10:50 am
by David de Argentina
Hi Virger,

Here is the EXE:

http://specialapps.rcmediaservices.net/files/WebCamServer.zip

The default path is the webcamserver.exe path.
The default open file is default.htm

At the remote client (phone, tablet, etc) you can write an URL that calls your NeoBook EXE program, like:

192.168.1.12/MiProgram.exe

or

MyExternalIP/MiProgram.exe

if you know remotelly the server esternal IP.
Use dynu services to get an URL for a dynamic IP. Works fine.


If your neobook program generates a response, it may be wrote in a "temp.htm" file, like:

FileWrite "temp.htm" "All" "Everything is OK"
or
FileWrite "temp.htm" "All" "[result_data]"

Enjoy it!
David de Argentina

Re: NeoBook as CGI program?

PostPosted: Thu Jun 08, 2017 11:01 am
by David de Argentina
Same program called from Opera browser at Android device using the External (dynu linked) IP:

Image

Re: NeoBook as CGI program?

PostPosted: Thu Jun 08, 2017 5:30 pm
by Neosoft Support
Wow! That's really interesting.

Re: NeoBook as CGI program?

PostPosted: Thu Jun 08, 2017 7:49 pm
by David de Argentina
Thanks Dave,

It's very interesting really...

If you run (on any device) this url:

http://aplicaciones.dynu.com/recordset.exe

you could get the NeoBook program working.



I'm working on a new version that allow send parameters.

At NeoBook side, Commandline action should do the work, but nothing happens

At Powerbasic side (the webserver program) main problem is when webserver launch the action, in this case, the NeoBook program.

Perhaps i will need some help in this theme.

Greetings from Buenos Aires,
David de Argentina

Re: NeoBook as CGI program?

PostPosted: Mon Jun 12, 2017 8:25 am
by dpayer
David de Argentina wrote:Thanks Dave,
It's very interesting really...
I'm working on a new version that allow send parameters.
At NeoBook side, Commandline action should do the work, but nothing happens
Perhaps i will need some help in this theme.
David de Argentina


David,

Perhaps a safer way than launching an executable via the webserver (imagine if someone finds a way to launch format.exe) would be to use a database as the means to exchange information with NB.

You can have NB monitor a table for changes. When an entry is made you could have NB verify the request from a catalogue of acceptable responses or run a subroutine with data provided in a form that makes an entry in the table.

In this case the DB is an intermediary and you should be able to control what actions are done based on the content of specific columns in the record.

Using this method, NB could be used to monitor existing applications (content management / databases / form responses, etc) and make existing data useful in ways not imagined by the developer of that app.

Re: NeoBook as CGI program?

PostPosted: Tue Jun 13, 2017 9:41 am
by David de Argentina
Hi DavidP,

Totally agree.

In order for this to be possible, it is necessary to be able to pass a parameter informing what is wanted to be done.

There is something strange about the way PowerBasic handles its own RUN function, which causes the parameter to be misinterpreted.

When I have some progress, I will let you know.

Regards,
David de Argentina