All Projects → saks → Lua Resty Repl

saks / Lua Resty Repl

Licence: mit
Interactive console (REPL) for Openresty and luajit code

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Lua Resty Repl

Lua Resty Redis Connector
Connection utilities for lua-resty-redis
Stars: ✭ 186 (+12.73%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Http
Lua HTTP client cosocket driver for OpenResty / ngx_lua.
Stars: ✭ 1,647 (+898.18%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Route
URL Routing Library for OpenResty Supporting Pluggable Matching Engines
Stars: ✭ 88 (-46.67%)
Mutual labels:  openresty, luajit, nginx
Jay
😎 Supercharged JavaScript REPL
Stars: ✭ 970 (+487.88%)
Mutual labels:  cli, readline, repl
Apioak
Full Lifecycle Management API Gateway.
Stars: ✭ 335 (+103.03%)
Mutual labels:  openresty, luajit, nginx
Luajit.io
luajit io framework
Stars: ✭ 277 (+67.88%)
Mutual labels:  openresty, luajit, nginx
Motan Openresty
A cross-language RPC framework for rapid development of high performance distributed services based on OpenResty.
Stars: ✭ 117 (-29.09%)
Mutual labels:  openresty, luajit, nginx
Croissant
🥐 A Lua REPL and debugger
Stars: ✭ 285 (+72.73%)
Mutual labels:  cli, debugger, repl
Lua Resty Post
HTTP post utility for openresty
Stars: ✭ 30 (-81.82%)
Mutual labels:  openresty, luajit, nginx
Api Umbrella
Open source API management platform
Stars: ✭ 1,735 (+951.52%)
Mutual labels:  openresty, luajit, nginx
Psysh
A REPL for PHP
Stars: ✭ 9,161 (+5452.12%)
Mutual labels:  cli, repl
Repl
🐚 an instant REPL for any command
Stars: ✭ 71 (-56.97%)
Mutual labels:  cli, repl
Ngr
A high-performance & enterprise-class edge gateway middleware
Stars: ✭ 89 (-46.06%)
Mutual labels:  openresty, nginx
Lua Cassandra
Pure Lua driver for Apache Cassandra
Stars: ✭ 95 (-42.42%)
Mutual labels:  openresty, luajit
Lua Resty Redis Util
openresty/lua-resty-redis 封装工具类
Stars: ✭ 90 (-45.45%)
Mutual labels:  openresty, nginx
Leevis.com
Blog
Stars: ✭ 65 (-60.61%)
Mutual labels:  openresty, nginx
Flask Konch
An improved shell command for the Flask CLI
Stars: ✭ 65 (-60.61%)
Mutual labels:  cli, repl
Bull Repl
Bull / BullMQ queue command line REPL
Stars: ✭ 121 (-26.67%)
Mutual labels:  cli, repl
Arkade
Open Source Kubernetes Marketplace
Stars: ✭ 2,343 (+1320%)
Mutual labels:  cli, nginx
Lua Resty Auto Ssl
On the fly (and free) SSL registration and renewal inside OpenResty/nginx with Let's Encrypt.
Stars: ✭ 1,786 (+982.42%)
Mutual labels:  openresty, nginx

Welcome to Resty Repl

Features

Resty Repl is a powerful alternative to the standard luajit shell ispired by pry. It is written from scratch to provide a number of advanced features, including:

  • Full read/write access to locals, upvalues and global variables
  • Pretty print for objects
  • A Powerful and flexible command system
  • Ability to view and replay history
  • Ability to see a context and source of the place in code from where repl was started
  • Runtime invocation (use Resty Repl as a developer console or debugger)
  • Tab completion
  • Simple and easy way to debug lua running in the nginx (openresty)

Runtime invocation

First install luarock

luarocks install lua-resty-repl

Then just drop this snippet anywhere in your code:

require('resty.repl').start()

or run as cli:

resty-repl

Openresty debugger

But what makes it really nice is that now you can debug your openresty code right from running nginx!

master_process off;
error_log stderr notice;
daemon off;

events {
  worker_connections 1024;
}

http {
  server {
    listen 8080;
    lua_code_cache off;

    location / {
      content_by_lua_block {
        require('resty.repl').start()
      }
    }
  }
}

and start debugging:

$ curl -H X-Header:buz 172.17.0.2:8080?foo=bar

nginx -c /tmp/ngx.conf
2016/09/20 16:26:33 [alert] 2257#0: lua_code_cache is off; this will hurt performance in /tmp/ngx.conf:12
nginx: [alert] lua_code_cache is off; this will hurt performance in /tmp/ngx.conf:12
2016/09/20 16:26:33 [notice] 2257#0: using the "epoll" event method
2016/09/20 16:26:33 [notice] 2257#0: openresty/1.11.2.1
2016/09/20 16:26:33 [notice] 2257#0: built by gcc 4.9.2 (Debian 4.9.2-10)
2016/09/20 16:26:33 [notice] 2257#0: OS: Linux 4.4.0-38-generic
2016/09/20 16:26:33 [notice] 2257#0: getrlimit(RLIMIT_NOFILE): 65536:65536

From: content_by_lua(ngx.conf:17) @ line 2

[1] ngx(content)> ngx.req.get_headers()
=> {
  accept = "*/*",
  host = "172.17.0.2:8080",
  ["user-agent"] = "curl/7.47.0",
  ["x-header"] = "buz",
  <metatable> = {
    __index = <function 1>
  }
}
[2] ngx(content)> ngx.req.get_uri_args()
=> {
  foo = "bar"
}
[3] ngx(content)> ngx.say 'it works!'
=> 1
[4] ngx(content)> ngx.exit(ngx.OK)
172.17.0.1 - - [20/Sep/2016:16:26:50 +0000] "GET /?foo=bar HTTP/1.1" 200 20 "-" "curl/7.47.0"

Compatibility

Right now it's only compatible with:

  • luajit
  • lua5.1 (no readline)

Os Support

  • GNU/Linux
  • Mac OS

Roadmap

  • colorized output
  • smarter completion
  • full readline support for lua (no ffi environments)
  • remote debugger
  • command for showing function source
  • test suite with resty-cli, luajit and different versions of lua
  • better inspect library

Code Status

Build Status

License

resty-repl is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].