Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5970

debugg angular on firefox from windows when angular is being served on an ubuntu server on the same network

$
0
0

I have a ubuntu home server on my local network that I am using to develop this ionic angular application. I ssh into this ubuntu server from my main windows 11 computer and use NeoVim to edit it.

Up until how I just serve the app with the command:

ionic serve --host=0.0.0.0   --ssl

This way I am able to view the fronend while is being served on the ubuntu server. My problem is that I am trying now to debugg the code with the DAP plugin for NeoVim, and I am not sure if it's possible to connect DAP to the firefox debugger server if it's running on my windows 11 computer and not the server itself.

Any help would be apprecitated :)

here's what I've tried so far:

DAP.lua

return {  {'mfussenegger/nvim-dap',    dependencies = {'leoluz/nvim-dap-go','rcarriga/nvim-dap-ui','theHamsta/nvim-dap-virtual-text','nvim-neotest/nvim-nio','williamboman/mason.nvim',    },    config = function()      local dap = require 'dap'      local ui = require 'dapui'      require('dapui').setup()      require('dap-go').setup()      require('nvim-dap-virtual-text').setup {}      -- Configuration for .NET Core (ASP.NET Core) using net8.0      dap.adapters.coreclr = {        type = 'executable',        command = '/usr/local/bin/netcoredbg/netcoredbg', -- Update with the correct path to netcoredbg        args = { '--interpreter=vscode' },      }      dap.configurations.cs = {        {          type = 'coreclr',          name = 'Launch ASP.NET Core',          request = 'launch',          preLaunchTask = function()            -- Run the project before launching the debugger            local build_cmd = 'dotnet publish --configuration Debug --runtime linux-x64 --self-contained'            print('Running: ' .. build_cmd)            vim.fn.system(build_cmd)          end,          program = function()            local cwd = vim.fn.getcwd()            local dll = vim.fn.glob(cwd .. '/bin/Debug/net8.0/linux-x64/MelodyFitnessApi.dll', 0, 1)            if #dll == 0 then              print 'No DLL found in bin/Debug/net8.0/linux-x64'              return ''            end            print('Using program: ' .. dll[1])            return dll[1]          end,          cwd = '${workspaceFolder}',          stopAtEntry = false,          console = 'integratedTerminal',        },        {          type = 'coreclr',          name = 'Attach ASP.NET Core',          request = 'attach',          processId = require('dap.utils').pick_process,          cwd = '${workspaceFolder}',        },      }      -- Configuration for Ionic Angular (JavaScript/TypeScript) using Firefox      dap.adapters.firefox = {        type = 'executable',        command = 'node',        args = { os.getenv 'HOME' .. '/.vscode/extensions/vscode-firefox-debug/dist/adapter.bundle.js' },      }      dap.configurations.javascript = {        {          type = 'firefox',          request = 'attach',          name = 'Launch Firefox against remote localhost',          host = '192.168.1.9', -- IP address of main computer, the one running fire fox debug instance.          port = 6000,          url = 'https://192.168.1.11:8100', -- Ubuntu server's local IP address          webRoot = '${workspaceFolder}',          sourceMaps = true,        },      }      dap.configurations.typescript = dap.configurations.javascript      vim.keymap.set('n', '<space>tb', dap.toggle_breakpoint)      vim.keymap.set('n', '<space>gb', dap.run_to_cursor)      vim.keymap.set('n', '<space>?', function()        require('dapui').eval(nil, { enter = true })      end)      vim.keymap.set('n', '<F1>', dap.continue)      vim.keymap.set('n', '<F2>', dap.step_into)      vim.keymap.set('n', '<F3>', dap.step_over)      vim.keymap.set('n', '<F4>', dap.step_out)      vim.keymap.set('n', '<F5>', dap.step_back)      vim.keymap.set('n', '<F12>', dap.restart)      -- Key mapping to toggle the DAP UI      vim.keymap.set('n', '<Leader>dui', function()        ui.toggle()      end)      dap.listeners.before.attach.dapui_config = function()        ui.open()      end      dap.listeners.before.launch.dapui_config = function()        ui.open()      end      dap.listeners.before.event_terminated.dapui_config = function()        ui.close()      end      dap.listeners.before.event_exited.dapui_config = function()        ui.close()      end    end,  },}

And then on my windows computer via powershell I run this command to start the firefox debugging server

& "C:\Program Files\Mozilla Firefox\firefox.exe" --args --start-debugger-server 6000

I've also tried adding inboud TCP rules for the port 6000 on my windows 11 computer and just allow firefox through this port as well.


Viewing all articles
Browse latest Browse all 5970

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>