Git Product home page Git Product logo

erlang_nginx's Introduction

This is an experimental erlang extension for nginx.

Contributions are welcome. I don't claim to write beautiful c. The biggest thing you can do to help is to show me what I did wrong (nicely) so I can learn from it.

Build

From the nginx source directory, configure nginx with the module included.

$ ./configure --add-module=/path/to/erlang_nginx
$ make
$ make install

Meanwhile

$ erl -setcookie secret -sname handler@localhost
1> P = demo:start().
<x.x.x>

Running nginx and making a curl request ala

$ curl http://localhost/foobar
This...

Results in this output in Erlang:

{Pid, Method, Uri}: {<8207.9.0>, 2, "/foo" ++ _}

Configuration

location /app/ {
    erlang;
    erlang_node handler@localhost;
    erlang_secret secret;
    erlang_registered demo_handler;
}

TODO

  • ngx_http_erlang_module.c (66) - Get this from nginx.
  • ngx_http_erlang_module.c (69) - Set this during the erlang message recieve loop.
  • ngx_http_erlang_module.c (82) - Add secret to config
  • ngx_http_erlang_module.c (88) - Add node name to config
  • ngx_http_erlang_module.c (89) - Add node host to config
  • ngx_http_erlang_module.c (97) - Send the headers and request body
  • ngx_http_erlang_module.c (103) - Set the registered process that is the handler in the config.
  • ngx_http_erlang_module.c (106) - Find a way to fail gracefully if a message isn't recieved within
  • ngx_http_erlang_module.c (108) - Set the timeout duration in config.
  • ngx_http_erlang_module.c (120) - Handle response tuple: {StatusCode, Headers, Body}
  • ngx_http_erlang_module.c (126) - Set status code from response tuple

License

This software is Open Source under the MIT license.

erlang_nginx's People

Contributors

abhay avatar ngerakines avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.