We have Koa running fine on our main system but would like to run it on an Ubuntu 16.04 server we virtualise through VirtualBox. Support for seamless port-forwarding from VirtualBox to host machine via scripting would be a definite plus for us.
Port forwarding isn't really relevant to Koa, I'm assuming you're using Vagrant but it features port forwarding
No. VirtualBox. Vagrant is a different thing. THE WIZARD set it up, but I know a bit. And yeah, they're not the same thing. It would be a difficult feature to support, but it would be _very_ useful for us.
@tj Vagrant and VirtualBox are both virtual machines but they are not the same. Other examples of virtual machines are VMWare Player and VMWare Workstation. Often different virtual machines require very different parameters for port forwarding.
@tj Hi TJ! I love your work! But the guys are right, it is relevant because Koa is a server/middleware/scripting tool and we really need your help. Because right now our VirtualBox running Koa won't serve to our host IP address. And that's a bad thing.
VirtualBox via Vagrant I meant, but either way port forwarding is easily done at the OS level, no need for anything special here. Beyond that if you have an issue with binding, then it's a Node issue because Koa's listen() is just Node's listen(), if there's a problem it'll have to move over to node's repo.
Agreed, sorry but this is not within the scope of Koa. You might try developing your own Node.JS module for this (it wouldn't be within the scope of Koa middleware).
Also, you might try a bridged Virtualbox network adapter, it might mitigate this problem.
Shame you guys weren't able to help. Thanks for trying.
We have been trying a bridged adapter....
I've had no problems with Vagrant in the past: https://www.vagrantup.com/docs/networking/forwarded_ports.html
You suggest Vagrant instead of VirtualBox as the supported solution for Koa? I can go with that if it works.
Vagrant is just a thin layer on top VBox and others
I'll look into the solution you offered tomorrow. It's late in the UK and I spend too much time on work.
What about running nginx? I use that inside a Virtualbox machine, forwarding from port 80 (nginx) to port 4040 (koa app) and things work fine... I don't understand how koa can help, here, since you cannot do more with this module that the native http one does already. Or I'm totally off-topic and I am missing something obvious.
nginx as a load balancer is a good choose, which easy to set up different upstream address:port @ThePurpleRabbits
Closing since it's not koa specific.
oh it was closed :D oops
Most helpful comment
What about running nginx? I use that inside a Virtualbox machine, forwarding from port 80 (nginx) to port 4040 (koa app) and things work fine... I don't understand how koa can help, here, since you cannot do more with this module that the native
httpone does already. Or I'm totally off-topic and I am missing something obvious.