Improve bud run's --port flag #42
Replies: 6 comments 6 replies
-
If it's need to be two param, I strongly suggest to use |
Beta Was this translation helpful? Give feedback.
-
IMO, I would prefer bud run --bind-addr 127.0.0.1:3000 // too long
bud run --bind 127.0.0.1:3000 // just _ok_
bud run --url 127.0.0.1:4000 // but we also allow unix domain socket paths
bud run --address 127.0.0.1:4000 // ummm, wdyt?
bud run --listen 127.0.0.1:3000 |
Beta Was this translation helpful? Give feedback.
-
I think |
Beta Was this translation helpful? Give feedback.
-
I agree, I’d say |
Beta Was this translation helpful? Give feedback.
-
Currently leaning towards Will give it a day to see if anyone else brings something to the table, then make a call. |
Beta Was this translation helpful? Give feedback.
-
Recommend that initial problem include an example of setting the ip address. I do my coding on a headless go box and for some reason it wasn't picking up the 127.0.0.1 when I was hitting it remotely. (Weird) |
Beta Was this translation helpful? Give feedback.
-
Problem
There's been justified confusion over the
--port
flag.The
--port
flag is currently overloaded to support passing a host, port and path. You can find all the possibilities in this test file, but here's the gist:--port=5000
maps tohttp://127.0.0.1:5000
--port=:5000
maps tohttp://127.0.0.1:5000
--port=127.0.0.1
maps tohttp://127.0.0.1:3000
--port=localhost
maps tohttp://localhost:3000
--port=/tmp.sock
maps tohttp:///tmp.sock
--port=w.x.y.z
maps tohttp://w.x.y.z:3000/
--port=w.x.y.z:8080
maps tohttp://w.x.y.z:8080/
Original Goals
Personal Opinion
I completely agree that
--port
is confusing to say the least, but my preference would be to keep the unified input and change the name. The reason is that separate flags for host, port and unix domain socket path get to be a lot.Potential Solutions
One idea that came up in #35 was to use
--bind
. While I know this is the correct term for the action (e.g. binding to a port), I'm not in love with the term bind because it reminds me of too many other things:fn.bind(this)
)Can we come up with a simple, yet better keyword? Maybe
--url
or--address
? Any other ideas? Or do you think--bind
is the right call?✅ Update May 31, 2022
Decided to rename to
--listen
, which is now in main. Examples:--listen=5000
maps tohttp://127.0.0.1:5000
--listen=:5000
maps tohttp://127.0.0.1:5000
--listen=127.0.0.1
maps tohttp://127.0.0.1:3000
--listen=localhost
maps tohttp://localhost:3000
--listen=/tmp.sock
maps tohttp:///tmp.sock
--listen=w.x.y.z
maps tohttp://w.x.y.z:3000/
--listen=w.x.y.z:8080
maps tohttp://w.x.y.z:8080/
Beta Was this translation helpful? Give feedback.
All reactions