Closed larryw3i closed 4 years ago
Interesting... for development porpuses this could be really useful. This could be one of the "View options", right?
What do you think @75lb ?
yes, ws --qr
would be a useful feature. 👍
Which URL should the QR encode? When you run ws
, three URLs are printed: the hostname, local IP and one or more network interface IP addresses.
$ ws
Listening on http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000
Which of these URLs should the QR represent? We need to pass in an argument which identifies which URL to display as QR.
$ ws --qr en0
<print QR code for network interface with name 'en0'>
Please implement in lws. You'll need to update the built-in cli-view.
list-network-interfaces
option here. Make it a boolean flag. OptionDefinition objects are documented here.config.listNetworkInterfaces
is set, print value
(the address list) to the console so the user can see the network interface names.qr
option definition here with type String
. The value passed to --vr
should be an interface name (the user will first run ws --list-network-interfaces
to see the interface names).config.vr
is set. If so, search value
(an array of objects) for the object with a name
matching the supplied config.vr
value. Print a QR code for this object's url
value.Nice! I'm going to work on this.
If the user does not pass any argument we could print by default the URL that matches one of the IETF private address because that's probably the address the user is looking for when scanning with an external device that is in the same private (wi-fi) network. Right?
Yes, that sounds like a sensible default - using a mobile device on the same LAN is a common use case.
Would that default also work when both your laptop and mobile device are connected to a mobile network? Would be a bonus if so.
Like the laptop using the mobile as a hotspot, right? If so, it would work.
@larryw3i this issue is being built and discussed here https://github.com/lwsjs/lws/issues/13
Maybe generating qrcode is been needed, it's convenient if get my laptop files just scan the qrcode