Port Forwarding
As the sandbox network is encapsulated from the machines host network, port-forwarding must be used to actually expose ports to the public internet.
This is required IN ADDITION to Docker’s port forwarding functionality, as Docker port-forwarding will only expose the port to the sandbox network.
You can use the CLI or the dashboard to manage Box port forwarding.
Please note that a port-forwarding is very often not what you actually want. If you want to expose one of your boxes which is meant to service some HTTP(S) traffic, use a load-balancer instead.
Adding port-forwarding to a box
To add a port-forwarding, use the following command:
dboxed box add-port-forward <box-name> --host-port-first=<host-port> --sandbox-port=<sandbox-port>--host-port-first specifies the port on the machines’s host network and --sandbox-port specifies the port in the
sandbox.
Updating a port-forwarding
To update an existing port-forwarding, determine the ID first via:
dboxed box ls-port-forwards <box-name>This will output a table, including the ID field.
Then use this ID to update the port-forwards:
dboxed box update-port-forward <box-name> <id> --host-port-first=<host-port> --sandbox-port=<sandbox-port> --description=<description>Deleting a port-forwarding
To delete a port forwarding, run:
dboxed box rm-port-forward <box-name> <id>