i feel like i ask this every few months, sorry. :w...
# box-products
r
i feel like i ask this every few months, sorry. 😉 Using box in wsl and started a server. Confirmed it's running on 127.0.0.1:43385 via curl. tried the same in a Windows browser and no go. I can run another web server in wsl just fine, and my browser can access it at 127.0.0.1. Any suggestions? Running latest.
r
I don't have my personal laptop around to test, but I have run in to issues using 127.0.0.1 and had to bind to "localhost" instead.
Without my laptop I am just guessing though.
r
good idea on that, but it didnt work
thing is, another program, http-server, and others, have no problem starting up web servers in wsl, and i can hit em just fine in windows proper
for now i just switched back to windows box
r
@bdw429s might know some magic to make it work. I will check it out at lunch to see if I can get it working
r
its no rush really, i dont mind running w/ PowerShell 🙂
👍 1
r
The other thought was binding to 0.0.0.0 in WSL
but that is just another guess
r
oh interesting - if i box server list in wsl, i do see 0.0.0.0 used before
let me see if i ask for 0.0.0.0 on start if it works
r
Makes me miss my mac lol
b
Pretty sure, everyone who uses wsl binds to 0.0.0.0
r
givng that a shot now
in server.json, i did this but it was ignored: { "app":{ "cfengine":"adobe@2023", "port":"0.0.0.0" } }
r
host is the key you want
r
ugh
duh
b
I just run box in Windows. It runs the same in any operating system and dealing with processes, networking, and file systems is always easier directly on the host OS without any abstraction layers in the way 🤷
r
Copy code
{
  "app": {
    "cfengine": "adobe@2021"
  },
  "name": "cool app",
  "web": {
    "host": "0.0.0.0",
    "rewrites": {
      "enable": true
    }
  }
}
r
its being ignored by box..... ah
b
Host also goes in web
r
query, is there a doc that shows all server.json stuff?
like id idnt know host would go under web
b
Use the server set command. The tab completion will always keep you in track
r
i wanted to it in server.json though
b
Yes, CommandBox.ortusbooks.com has all this
Sorry, I'm on my phone ATM
Then use the commandbox vscode plugin, lol. It has a json schema for server.json
Or just type Server start host=0.0.0.0 And it will be saved for you in the correct place
r
ah cool
so yeah, it didnt help 🙂 it did bind to 0.0.0.0, but i still cant hit it. im going to give up for now - im getting stuff done in windows. i appreciate it though
b
Double check the port maybe
r
I will be heading for lunch here shortly. I will see if I can get it working
r
i did, no go
seriously though - i can stik with windows 🙂
👍 1
b
If you were running it in windows, you could just type "server open" or click in the tray icon to open the correct url. Everything is harder in WSL 😒
r
well, to be fair, everything else ive used in wsl, network wise, just works
like, box is the only program i know of that has issues with it
b
all I can do is bind the port. It's up to your networking stack you let you access it. ¯\_(ツ)_/¯
I think most tools bind to 0.0.0.0, but commandbox uses localhost to be secure by default.
r
well, again, respectfully, i love box. but when i say, nothing else does this... i mean it. nothing else does. web servers, etc.
b
I almost exclusively use CommandBox inside WSL. I'm surprised binding to host 0.0.0.0 didn't work. Could Windows Firewall be getting in the way?
r
let me kill it for a sec and see what happens
b
localhost:port is preferable to hit in the browser, but could you grab the IP out of WSL and try hitting it directly rather than using "localhost"?
r
so there's a CMD/PowerShell command to get the ip for wsl... and its 127.0.0.1 😉
b
I know how ridiculous this sounds, but you did restart the CommandBox server after defining the host, right?
r
ahah - so binding to 0.0.0.0, i can hit it as... localhost. turning firewalls back on
👍 1
ok, so the magic combination may be: use host 0, use localhost in browser
im making a freaking note so i dont freaking ask yall that same freaking questions again
r
It managed to entertain me for about an hour. that is pretty good
b
But you'd take away my Friday high for helping out the legendary Ray Camden
👍🏼 1
r
thank yall. i'll still say to @bdw429s - maybe consider seeing if there's something on the box side? like i said - i dont have this trouble w/o other apps
hahahah
CTRL+P to show my kids
im doing a quick CFC wrapper for the Photoshop API. trying to remember how to wrtite components 😉
r
I have a buddy who wrote some cool cfwack books
😂 1
I will see if i can dig em up
r
im so bad i just had an error trying to do: "let x = .."
😂 1
😀 1