[commandbox 5.2.1] set up for remote access within local network

Hello!

I’m trying to access a dev site on a local Windows 10 machine via my local network using an android tablet. I can’t seem to gain access. I tried various things with the wifi modem settings plus windows defender thinking one or the other blocking but not getting anywhere. After quite awhile at this I tried a plain IIS html site using same method on a another high numbered non-standard port set up the same way and it comes right up so I’ve got the firewall set ok it seems. It appears the server used to launch my test sites within Box has its own security that I’m having a heck of a time figuring out. Does anyone know how to set it for access outside the host machine (on my local network)?

Thank you!

What host do you have CommandBox bound on? It needs to either be on a LAN IP or 0.0.0.0 to be accessible externally. These are just basic networking rules. By default, the host will be localhost, which isn’t accessible outside the machine.

1 Like

Sorry, probably should have been more specific. So my present server running from Coldbox is -

192.168.0.2:54754

the one running under a test html site in IIS is

192.168.0.2:50635

In both cases I set up the appropriate (or at least identical) settings in Windows Defender and I can hit the second one from my tablet over wifi no problem. The first one (the server fired up from commandbox) simply times out. They BOTH run fine locally from the laptop they’re hosted on of course. So I’m thinking there’s some default rule in the server maybe that’s not allowing connections outside the laptop itself? For the record I’m simply doing “server start”.

CommandBox has no such settings to deny connections. I’m guessing the firewall isn’t letting the traffic through.

Hmm, weird. In Windows Defender I made two identical new rules. One for the port the Lucee server is using and one for my test IIS site. Both are identical in every way except for the port numbers. In the one that I have the IIS site bound to I can access remotely (within my wifi) no problem. The other hitting whatever server is hosting for Lucee no dice. I believe the underlying server for the CommandBox server is Undertow right? I’ve been googling everything I can find on undertow and access rights and nothing seems to be working. It just seems like it defaults to not allowing any external access. I’ve got to think people are doing similar to what I am (testing dev sites on phones and tablets). No ideas? I’ll keep looking. I know it’ll work but seems like it ought to be a no-brainer. Thank you!

Had an idea and now I’m pretty cerrtain it’s in the server setup (Undertow I guess) rather than a firewall in Windows or the modem. I switched ports. I set IIS test site to use 54754 and set Undertow to use 50635 (server start port=50635), the reverse of before. Same results. Both come up locally just fine but, again, only the IIS one comes up via the tablet on the local network. No way possible it’s Windows Defender I think since reversing the ports used gets same results. I’ll keep looking up Undertow information online. If I find anything and get it working I’ll report back here.

Undertow has no such setting that I’m aware of. I’d use netstat to confirm the port and IP are bound as you expect. Also check defender or any other antivirus you may have installed for rules that affect java.exe. So long as netstat shows the port is bound on the right IP, CommandBox and Undertow are working correctly. If it’s still not working, the issue lies outside of those and somewhere in Windows or your network.

Finally got there by downloading Wildfly itself and messing around. Turns out it’s awful simple. If anyone stumbles on this because you’re trying to test your responsive design on a tablet (for instance) note that you’ll need to start the server on your laptop like so -

server start port=50635 host=0.0.0.0 where port is the one you’ve opened in Windows Defender and host is something that can be reached on your local network (0.0.0.0 is “all”). Could also use your laptop’s local IP address, for instance in my case

server start port=50635 host=192.168.0.2

Maybe this was rudimentary but took my awhile to get there so thought it might help someone else.

Thank you!

1 Like

And actually it’s EXACTLY what Brad had said above but somehow I misinterpreted it. So kind of a repeat. Thank you Brad (belatedly)!

It has been a life-saving solution method, we were stuck at this stage in the live migration and we were able to solve it thanks to the post.

Thanks for all