Skip to content

Open a web app in your mobile browser by scanning a QR code

Lloyd Brookes edited this page May 17, 2020 · 2 revisions

Use the --qr option to print a QR code for the desired URL.

Example usage

The default behaviour will print a QR code for the first available Local Area Network IP address. This is typically all you need.

$ ws --qr
Listening on http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000

QR code for http://192.168.0.200:8000:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▀▀▄▄▄▀█▄█ ▄▄▄▄▄ █
█ █   █ ███▄█  ▀▀▀█ █   █ █
█ █▄▄▄█ ██▄▀▄▀███▀█ █▄▄▄█ █
█▄▄▄▄▄▄▄█ █ ▀▄▀ █▄█▄▄▄▄▄▄▄█
█ ▄▀  █▄██ ▄▄▀██ ▀▀▄█▀▀▀▀▄█
██▄ ▄▄▀▄██▀  ▀█▄ █ ▄▄  ▀▀ █
█▀▀█▀ █▄ ▀ █▄▄█▄▀▄▄▄▀▀██▀▄█
█ ▄██▀▀▄▀▄ ▀ ▄█▀▄ ▄██▀▄ ▄ █
█▄█▄▄█▄▄▄ ▀█▀   ▀ ▄▄▄ █▄ ██
█ ▄▄▄▄▄ ██▀█▄   █ █▄█ ▄█▀ █
█ █   █ █   ▀▀██▄▄▄  ▄ █▀▀█
█ █▄▄▄█ █▀▀█  █▄▀█▀▀▀ █   █
█▄▄▄▄▄▄▄█▄▄█▄██▄▄▄█▄██▄██▄█

To print a QR code for a URL on a different network interface, use the --list-network-interfaces option to view the available interface names.

$ ws --list-network-interfaces

Available network interfaces
- hostname: mba4.local
- lo0: 127.0.0.1
- en0: 192.168.0.200

Then supply the chosen interface name to --qr.

$ ws --qr hostname
Listening on http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000

QR code for http://mba4.local:8000:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▄▄ ▀█▀█▄█ ▄▄▄▄▄ █
█ █   █ ██▄▀ █ ▀ ▀█ █   █ █
█ █▄▄▄█ ██▀▄ ▄▄██▄█ █▄▄▄█ █
█▄▄▄▄▄▄▄█ ▀▄█ ▀ █▄█▄▄▄▄▄▄▄█
█ ▄▀▄ █▄██▄▀█▄██ ▄█▄▀▀▀▀▀▄█
█ █ ▄▄▄▄█▄▄██▄█▄  ▄ ██ ▀▀ █
█ ██▄  ▄ █  █▀▀▄   ▄▄▀██▀▄█
█ ▄ ▀  ▄▄ ▄ █▀▄▀ █▄ ▀█▄ ▄ █
█▄█▄▄▄▄▄▄▀▄█ ▄▄ █ ▄▄▄ █▄ ██
█ ▄▄▄▄▄ ███▀▀▄  ▀ █▄█ ▄██▄█
█ █   █ █ ▄█▄▀ ▀▄ ▄ ▄▄ █  █
█ █▄▄▄█ █▀▀█ ▀ ██▄▄█  █   █
█▄▄▄▄▄▄▄█▄▄█▄▄▄██▄▄███▄██▄█
Clone this wiki locally