guysv / ilua

Portable Lua kernel for Jupyter
GNU General Public License v2.0
115 stars 11 forks source link

feat: support openresty #25

Open oowl opened 1 year ago

oowl commented 1 year ago

support openresty luajit interactive

guysv commented 1 year ago

Hey thanks for the PR! Could you please instruct me on how to use it?

oowl commented 1 year ago

Ok, https://github.com/openresty/lua-nginx-module running luajit on Nginx, And it impl some nginx api in luajit, so i want to use ilua online to execute this nginx related api. i use websocket to connect openresty server, use websocket message to trigger lua execute and complete, and return result to jupyter. Just install openresty, and then exec ilua -i openresty

guysv commented 1 year ago

Okay I managed to try it out!
First, there's a missing module exception for autobahn. consider adding it to the dependencies.

Second, very cool.

image

I see ssl is not implemented. Maybe we can self-sign ssl certs and configure openresty to use them so the console will have access to the ssl module. But maybe that's a feature for later 🤣


Now regarding actually merging this.
I'd like to ask you to consider publishing this as a stand-alone package. You can depend on ilua for the kernel classes and override what you need. If you need help API-wise for such integration i'd love to help! But I actually think you can manage to get this working just by subclassing my kernel.

oowl commented 1 year ago

I will consider creating iresty repo to achieve this( using ilua for the kernel classes ), but now I have no more time to do this. This implement looks dirty now.