Giter Club home page Giter Club logo

xavante's Introduction

Xavante

Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture based on URI mapped handlers. Xavante currently offers a file handler, a redirect handler and a WSAPI handler. Those are used for general files, URI remapping and WSAPI applications respectively.

Xavante is free software and uses the same license as Lua.

You can install Xavante using LuaRocks:

luarocks install xavante

The Xavante package provides just the Xavante libraries. To see Xavante in action install wsapi-xavante from LuaRocks.

Dependencies

Xavante dependencies can be separated by the used handlers:

  • Lua 5.1, 5.2 or 5.3
  • Copas 1.2.0
  • LuaSocket 2.1
  • LuaFileSystem 1.6 (file handler only)

The portability of Xavante is determined by its binary components (LuaSocket and LuaFileSystem) and Lua itself. The other components are written in Lua and are as portable as Lua itself.

Credits

Xavante is maintained by Fábio Mascarenhas and the community of contributors. See the GitHub logs for detailed credits.

Xavante circa 1.3 was implemented by Javier Guerra, André Carregal, and Fabio Mascarenhas with the help of Ignacio Burgueño, Zachary P. Landau, Mauricio Bomfim, Matthew Burke, Thomas Harning and others.

Xavante 1.2 was implemented by Javier Guerra, André Carregal, Fabio Mascarenhas and Leonardo Godinho.

Xavante 1.1 was redesigned and implemented by Javier Guerra and André Carregal. It merged Javier's work with luahttpd and André's work with Copas and Xavante 1.0. luahttpd is now part of Xavante.

Xavante 1.0 was designed and implemented by André Carregal as part of the Kepler Project with contributions from Renato Crivano and Danilo Tuler. Xavante 1.0 development was sponsored by Fábrica Digital and Hands.

xavante's People

Contributors

dqkev avatar hishamhm avatar jjensen avatar kognix avatar mascarenhas avatar mpeterv avatar srdgame avatar timn avatar vshulga avatar wittbulter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xavante's Issues

create a tag for version 2.2.1

You appear to have released version 2.2.1 two years ago but not created a tag for it in the git repository. Please create a tag for it.

make Keep-Alive non case-sensitive

Connection: Keep-Alive
connection: Keep-Alive
Connection: keep-alive
connection: keep-alive

all variants should work.
at the moment, only the first two variants work.

FastCGI support with this library

I have written a library that can call FastCGI processors through unix sockets and TCP sockets. With this Lua programs can render PHP pages. Using this to make Xavante support PHP pages will make Xavante more powerful.

Project URL: github.com/imzyxwvu/lua-fastcgi

Redirect all requests to one file

Hey!

I'm making a framework a web framework for Lua that I can use for some projects I have coming up and wondered how I configure the Xavante server to take all requests but redirect everything to index.lua? Kind of like PHP Frameworks.

I use it behind nginx as well and proxy pass it.

Thanks,
Danny

SSL support?

Is it planned? I've seen some patches in google groups, but from what I see they're not applied.

Update Luarock

Can I ask you to update the luarockt for this project, please?

I'm sorry I did not explain myself. I'm Massimiliano Bertinetti and I'm the new lead developer of Sailor. By applying the master branches of the packages on which sailor depends I managed to put into production Sailor with Lua 5.3. If published on Luarocks I can also update Sailor with new dependencies and allow Sailor users to use Lua 5.3 with Sailor 0.6.0. Thank you!

attempt to call field 'makeGenericHandler' (a nil value)

why is wsapi.xavante.makeGenericHandler now missing? (worked till yesterday, before upgrade)

local xavante = require "xavante"
local filehandler = require "xavante.filehandler"
local wsx = require "wsapi.xavante"

-- Define here where Xavante HTTP documents scripts are located
local webDir = "/var/www"

local simplerules = {

    { -- WSAPI application will be mounted under /app
      match = { "%.lua$", "%.lua/","%.lua?" },
      with = wsx.makeGenericHandler(webDir) 
    },

    { -- filehandler
      match = ".",
      with = filehandler,
      params = {baseDir = webDir}
    },
}

-- Displays a message in the console with the used ports
xavante.start_message(function (ports)
    local date = os.date("[%Y-%m-%d %H:%M:%S]")
    print(string.format("%s Xavante started on port(s) %s",
      date, table.concat(ports, ", ")))
  end)

xavante.HTTP{
    server = {host = "*", port = 8080},

    defaultHost = {
        rules = simplerules
    },
}

xavante.start()
th server.lua 
/opt/torch/install/bin/luajit: server.lua:19: attempt to call field 'makeGenericHandler' (a nil value)
stack traceback:
    server.lua:19: in main chunk
    [C]: in function 'dofile'
    /opt/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00405d70

Bad status code formatting: 200.0 OK

I'm running xavante on a Raspberry Pi 2 with Arch Linux ARM. The problem I'm seeing is that xavante is responding with a status code of 200.0 instead of 200, which is causing problems for a Python urllib script.

I'm running Lua 5.3.3 with wsapi 1.6.1-1 and xavante 2.4.0-1 installed via LuaRocks.

-- status_test_case.lua 
#!/usr/bin/env wsapi.cgi
local json = require'cjson'
local socket = require'socket'
local t = {a='foo', b='bar'}
cgilua.contentheader('application', 'json')
cgilua.put(json.encode(t))

Running curl -v, the 200.0 status code can be seen.

$ curl -sv "http://catbert:8080/status_test_case.lua" 2>&1
*   Trying 192.168.1.125...
* Connected to catbert (192.168.1.125) port 8080 (#0)
> GET /status_test_case.lua HTTP/1.1
> Host: catbert:8080
> User-Agent: curl/7.49.1
> Accept: */*
> 
< HTTP/1.1 200.0 OK
< Content-Type: application/json
< Date: Mon, 04 Jul 2016 03:49:15 GMT
< Server: Xavante 2.3.0
< Content-Length: 21.0
< 
* Connection #0 to host catbert left intact
{"b":"bar","a":"foo"}

lua: web.lua:7: attempt to index a nil value (global 'xavante')

I am trying to run the example:

-- web.lua
require "xavante"
require "xavante.filehandler"

port = ...

xavante.HTTP {
  server = { host = "*", port = tonumber(port) },
  defaultHost = {
    rules = {
      {
        match = "/$",
        with = function(req, res)
          res.headers["Content-type"] = "text/html"
          res.content = "hello world, the time is: " .. os.date()
          return res
        end
      }, {
        match = ".",
        with = xavante.filehandler,
        params = { baseDir = "static/" }
      }
    }
  }
}

xavante.start()

To run this I did:

  1. sudo apt install lua5.3 lua5.3-dev luarocks
  2. luarocks install --local xavante
  3. lua web.lua 5000

module 'kepler_init' not found in v2.1.0

I'm getting this:
lua: /opt/local/share/lua/5.1/xavante/cgiluahandler.lua:12: module 'kepler_init' not found
From:
require 'xavante'
require "xavante.filehandler"
require "xavante.cgiluahandler"

And I see from
$ git diff v2.1.0..HEAD src/xavante/cgiluahandler.lua
that require 'kepler_init' has since been removed from that file.

store session between xavante restarts

As described here:

In the current implementation, the session's stored data is just a Lua table, and is only stored in memory. If Xavante is restarted, all session data is lost.

How to store session between xavante restarts?
It's very inconvenient to debug admin page functionality because session data is completely lost after xavante server restart/reload.

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.