Debugging locally with port forwarding

Overview

Modern development is not complete without the option to run debugging tools that allow you to go through the execution line-by-line, see the call stack and variable values, evaluate expressions and many others. It's simply not acceptable anymore to print debugging output to understand the context.

📘

Bunnyshell's Remote Development allows you to use the exact same tools you're running on local, in the exact same way, but run them in a container in the cloud instead.

Basically, you will use the --port-forward option when starting Remote Development from the CLI, and have the debugger's container port exposed locally, so you will be able to connect the IDE to the debugger in the same way.

From a tooling perspective, you get to use the same favorite IDE and all connected tooling for linting, running tests etc. Basically nothing changes, apart from you running the bns remote-development up command, which you can also integrate within your IDE.

From a port-forwarding perspective, there are two types of debugging tools:

  • debugging tools which use port forwarding (eg. node.js, JVM)
  • debugging tools which use reverse port forwarding (eg. PHP)

Let's take a look at some examples to see how they would work with Bunnyshell's Remote Development.


Examples