local-lua-debugger-vscode icon indicating copy to clipboard operation
local-lua-debugger-vscode copied to clipboard

Attach to nginx?

Open vanheck opened this issue 6 years ago • 4 comments

Hello, is it possible to attach debuger to nginx lua script?

vanheck avatar Jul 26 '19 11:07 vanheck

I'm not familiar with nginx or it's lua support, so I can't say for sure if it's supported.

It might work if you can launch nginx as a custom lua executable and if it supports lua's io.read and io.write functions. But, if you're trying to attach to a running nginx instance, it won't work.

tomblind avatar Jul 26 '19 15:07 tomblind

ZeroBrane Studio works fine for remote debuging with nginx and any other lua extensions. https://studio.zerobrane.com/doc-remote-debugging - they using MobDebug https://github.com/pkulchenko/MobDebug (I'm not sure if it's the right repo). I not find the solution which works with VS Code.

vanheck avatar Jul 27 '19 06:07 vanheck

Yes, remote debugging is the big missing feature of this plugin right now. There are other VSCode extensions that support it, though. I believe nginx uses luajit, right? Maybe one of these will work:

  • https://marketplace.visualstudio.com/items?itemName=devCAT.lua-debug
  • https://marketplace.visualstudio.com/items?itemName=beamng.luadbg

At some point, when I get time, I may add support for remote debugging.

tomblind avatar Jul 27 '19 12:07 tomblind

Adding remote debuging feature will be fine, I like your vscode extension, it works well under Linux (I tested linux only).

Yes, nginx using luajit. These extension, especially the first one doesn't work in linux. The support and documentation is in chinesse (my guess) only :/.

vanheck avatar Jul 29 '19 08:07 vanheck