Introducing nginx-perl

Hello, everyone.

I'm happy to announce the first release of nginx-perl, version 1.1.11.1:

http://zzzcpan.github.com/nginx-perl/

Nginx-perl provides asynchronous functions for original embedded perl to resolve domain names, connect to external hosts, exchange data and most importantly respond to HTTP clients. Code sample can be found on the web page above.

Features

  • full official nginx perl API
  • asynchronous connections (ngx_connector, ngx_reader, ngx_writer)
  • timer (ngx_timer)
  • SSL (ngx_ssl_handshaker)
  • resolver (ngx_resolver)
  • access handlers (perl_access)
  • app handlers (perl_app)
  • configuration level eval (perl_eval)
  • init_worker, exit_worker handlers (perl_init_worker, perl_exit_worker)
  • logging functions (ngx_log_*)
  • client connection takeover for websockets, etc.

In many ways it is an actual asynchronous framework.

You can install it from sources manually with your favorite nginx addons:

    % perl Makefile.PL --with-http_ssl_module
    % make
    % make test
    % make install
      # or to try without installation
    % ./objs/nginx-perl -p eg/helloworld

Or from CPAN:

    % cpan Nginx::Perl

Documentation is far from perfect, but should be enough for people already familiar with embeeded perl.

Github:

https://github.com/zzzcpan/nginx-perl

5 Comments

Cool. As a long time mod_perl user, I would like to try this out someday. Been wanting to migrate to nginx and ditch Apache for some usage scenarios.

Next step: putting a PSGI adapter on top of that.

It seems that yours is less experimental than his – or at least it seems that way from his disclaimers. A thin PSGI adapter on top of your full-featured interface might be a better idea than a direct, stand-alone one.

Leave a comment

About Alexandr

user-pic I blog about Perl.