Hi Alexander,

On 22.12.2010 14:42, Alexander Konotop wrote:
The dates in git are not so old, really. So are you working on it
rarely or you have abandoned it?
I do not really need this, so I am working on it when I am in the mood and have some free coding time. I think this is something that would be nice to have and maybe I will need it some day.
I would join you if you are not against.
Feel free. Any help is appreciated.
But now I don't know, can I help or not. I can write in C or haxe but I
can't write in neko. But I can learn :-) - as for me it's very similar
to C.
It is actually written in the C++ (but I use only basic language features, because I am not so familar with C++) and haXe, so you don't have to write any neko code. The idea is that you have a module which is written in C++ which holds most of the functions. The haxe wrapper classes simply load this module and call these functions from the c code. This module also works fine with the haXe c++ target so you also use a compiled c++ application as backend (which will give you amazing speed.)
P.S. I don't have much time too, so I REALLY understand you )
You could start to try improve the existing code. Pick one of the unimplemented functions from the web class and look how you could realise to implement it. If you have any question you could write me a mail in private.
P.P.S. Ich kann sprache Deutcsh auch. Aber noch nicht so gut. (I see,
your email ends with .de)
Ich denke es ist einfacher bei Englisch zu bleiben. / I think it easier to stick to english.

Philipp
В Wed, 22 Dec 2010 14:08:47 +0100
Philipp Klose<[email protected]>  пишет:

When running as CGI you will have:
- GET parameters ->  program arguments
- Headers ->  system environment
- POST data ->  passed via stdin.

A while ago i started to code a wrapper library to wrap cgi / fcgi in
the standart haxe Web class. The result were promising but I never
had the time to finish. If you like you could take a look at it:
https://github.com/TheHippo/hxfcgi


On 22.12.2010 12:14, Nicolas Cannasse wrote:
Le 22/12/2010 11:48, Alexander Konotop a écrit :
Hello. Does anyone have experience in using neko as a web backend
without apache? I have set it up in lighttpd and even in IIS.
Everything's good but HTTP input data - I can't recieve POST/GET.

1. That's how simply lighttpd handles neko:
server.modules += ( "mod_cgi" )
cgi.assign = ( ".n" =>   "/usr/bin/neko" )
And that's all I've done in server config.

2. Code in haxe:
//Gettest.hx
class Gettest {
    public static function main()
   {
      trace(neko.Web.getParamsString());
    }
}
//gettest.hxml
-neko gettest.n
-main Gettest.hx

3. CGI output:
// http://localhost/nekocgi/gettest/gettest.n?a=2
Gettest.hx:5:
// nothing?

4. nekotools server output:
// http://localhost:2000/gettest.n?a=123&b=1234
Gettest.hx:5: a=123&b=1234

In truth I do not understand how nekoserver redirects
POST/GET data to nekovm. So I don't understand how to make another
server (nginx, lighttpd, IIS, or any other) do the same.
In the case of mod_neko everything's clear: mod_neko is a part of
apache.
Last time I started thinking about using nekoserver as a backend
and lighty as a frontend (same way as a popular combination of
nginx+apache). But nekoserver isn't known to be recommended on a
production server.
So what can you advice? Not to waste time and install apache? I
don't like it... And what can you say about performance in CGI
mode? In case of (for example) Perl every time when request comes
to a web-server the interpreter is loading from HDD to memory, so
CGI is slow. But neko is really small!!! So I thought it will be
quiet fast. Am I wrong?
CGI runs commands, so your web server will run the following
command :

neko /absolute/path/to/gettest.n
http://localhost/nekocgi/gettest/gettest.n?a=2

If you look at neko.Web implementation (in haxe/std/neko/Web.hx)
you'll see that if neko is not run from inside mod_neko, it will
use the first argument as URL. This has not been tested a lot, but
should work.

I wonder how CGI sends POST data, maybe through environment
variables ? Try printing neko.Sys.environment()

Nicolas



--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to