Comments (11)
Yeah, I think that'd be cool and helpful.
from miniserve.
That's a cool idea. How would we decide on which IP the QR-code would target ? An argument like --qr-code=my.public.ip.address
maybe ?
from miniserve.
Maybe we can figure out the local domain (from /etc/resolv.conf domain
) and hostname and construct the full local hostname that way?
from miniserve.
I think we could borrow a lot from Quair. Specifically local IP address detection and how to display a QR code in the terminal. EDIT: we can't actually copy-paste code because it's MPL2 and miniserve is MIT. But we can see what libraries they use, and things like that. Also maybe the quair developer would like to join forces with us, since they seem to have similar goals.
qrcodegen looks like a great option for generating the SVG version of the code for use in the web interface.
from miniserve.
Yeah, quair seems really neat. I wish it were a library. The IP stuff seems easy enough.
from miniserve.
There also is https://github.com/kennytm/qrcode-rust which does image, svg and text encoding of QR-codes.
from miniserve.
We now have a QR code in the HTML. We don't yet have one on the terminal but I'd be open for that option, too.
from miniserve.
If the user uses the -i
option, the content of the QR code should be http://{-i}:{-p}
.
If the user does not use the -i
option, then search for interfaces
, then the content of the QR code should be http://{interface}:{-p}
.
Looks like this:
miniserve v0.7.0
Serving path .../miniserve at http://[::]:8080,
http://127.0.0.1:8080
██████████████ ██ ██████████ ██████████████
██ ██ ██ ██ ██ ██ ██ ██
██ ██████ ██ ██ ██████ ██ ██████ ██
██ ██████ ██ ██ ██ ██ ██ ██████ ██
██ ██████ ██ ██ ██████ ██ ██ ██████ ██
██ ██ ████████ ████ ██ ██
██████████████ ██ ██ ██ ██ ██ ██████████████
██ ██ ████
██ ████ ██████████ ██ ██ ██████ ██
██ ██ ██ ████ ██ ████ ██████
██ ████ ██ ██ ██ ██ ██████ ██ ██
██ ██ ██ ██ ██ ██████ ██ ██
██ ████ ██ ████ ████ ██ ██ ██
██████ ████ ██ ████ ██ ██ ██████
████████ ████████████████ ██ ██ ████ ██
████ ████ ████████ ████ ████ ██ ██
██ ██ ██ ██ ██████████████ ██ ██
████ ██ ██ ██ ██ ████
██████████████ ██ ██ ██ ██ ██ ████ ████
██ ██ ██ ██ ████ ██
██ ██████ ██ ████ ██ ████████████ ████
██ ██████ ██ ████████ ██ ██ ████ ██
██ ██████ ██ ██ ██ ██████ ████
██ ██ ████ ██ ████ ████ ██████
██████████████ ██████ ████ ██████████████
Quit by pressing CTRL-C
It should be noted that how to print the QR code when using multiple -i
? Or print multiple QR codes?
from miniserve.
Hm yeah, I wonder. I think multiple QR codes would be weird. Maybe only print the IPv4 QR code to be safe?
from miniserve.
If only one QR code is printed, then when we run:
miniserve . -i 127.0.0.1 -i 192.168.0.40
What should be the content of the QR code?
from miniserve.
Haha, good point! Well, maybe it does make a good deal of sense to print one QR code per listening interface, then.
from miniserve.
Related Issues (20)
- Can the compilation target i686-pc-windows-msvc be added to run on a 32-bit Windows? HOT 15
- Panic when serving non-existent file in SPA mode HOT 1
- support setting permission?
- (systemd) error: unexpected argument ' ' found
- panicked at 'modification time must be after epoch: SystemTimeError(28800s)' HOT 6
- Unable to serve files with embedded newline HOT 2
- hope to add ignore file/dir list parameter HOT 1
- Failed test bind_ipv4_ipv6::case_2 HOT 2
- Does it support hiding some files? HOT 6
- Can't Upload HOT 1
- Add cli flag to disable indexing HOT 1
- Not working with reverse proxy in specific directory HOT 2
- Wget footers : hostname:port is repeated
- Feature request: custom subtitle
- rendering markdown files? HOT 6
- Set upload size limit HOT 2
- Save uploaded file atomically HOT 2
- 上传onedrive问题 HOT 4
- How to use HTTPS HOT 1
- Add Support for HSTS to Enhance HTTPS Security HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniserve.