/musasaua

http library on top of luvit

Primary LanguageLua

summary

musasaua is a http/https library with built in support for proxy, cookies and redirect, written in pure Lua on top of Luvit.

WTF musasaua means?

musasaua means "force passage" in nheengatu

help and support

please fill an issue or help it doing a clone and then a pull request

license

BEER-WARE, see source

basic usage

    
    -- require library
    local musasaua = require 'musasaua'

    -- new instance
    local http = musasaua:new()
    
    --
    http.enable_debug = true
    http.read_timeout = 20000 -- in mileseconds

    -- request content, thru proxy, keep alive ...
    http:request(
      {
        url    = 'http://example.com/index.html', -- using proxy (polipo)
        method = 'CONNECT', 
        domain = '127.0.0.1', 
        port   = 8123
      },  
      function(data)
        if data and data.code==200 then
          print(data.body)
        end
      end
    )

test

... in progress

TODO

  • support luvit module style
  • create a test suite
  • create a wiki?

% April 25th, 2013 -03 GMT