Tunnels and the CLI
Run the hoshime CLI on your own machine so the browser reaches sites through your connection.
View as MarkdownA tunnel sends hoshime’s browser traffic out through a machine of yours. You run hoshime tunnel on that machine; it opens one outgoing connection to hoshime and keeps it open, so no port is opened and no router is configured. Sites see that machine’s address and network, such as a home or office connection, instead of a data center.
Install
macOS and Linux:
curl -fsSL https://hoshime.com/install.sh | sh
Windows (PowerShell):
irm https://hoshime.com/install.ps1 | iex
The scripts check the download’s SHA-256 before installing. hoshime version prints what you have; run the script again to update.
Connect a machine
hoshime login # signs in with your browser
hoshime tunnel # connects, named after the machine; or --name home
hoshime login opens hoshime in your browser. After you sign in and allow it, hoshime creates an API key for the CLI with full access to your account, like a dashboard key with Full access, named after the machine, and the CLI saves it. The key does not expire, so there is nothing to renew; it works until you revoke it under API keys. On a machine without a browser, such as a server you reach over SSH, create a key in the dashboard with the tunnels:read and tunnels:write scopes and run hoshime login --with-key (it asks for the key) or hoshime login --key hsk_....
The key is saved encrypted in the system keychain: the Keychain on macOS, the Credential Manager on Windows and the Secret Service (GNOME Keyring or KWallet) on Linux. On a machine without one, such as a Linux server, it is saved in your user config directory instead (~/.config/hoshime/config.json), readable only by you. HOSHIME_API_KEY or --key override it. Over SSH on macOS the Keychain is locked: run security unlock-keychain first, or set HOSHIME_API_KEY.
The tunnel is registered on its first connect. It reconnects by itself after a network drop, sleep or restart on either side, waiting from 1 to 30 seconds between tries. It stops only on an error retrying cannot fix: a revoked key, a deleted tunnel, the plan’s tunnel limit, or another machine connecting under the same name.
Use it
Pass the tunnel’s name or id as tunnel:
curl https://api.hoshime.com/v1/browser/scrape \
-H "Authorization: Bearer $HOSHIME_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "tunnel": "home"}'
Scrape, crawl and screenshot requests accept it, and so do live logins (POST /v1/browser/live), Bing and DuckDuckGo searches and rank checks (POST /v1/serp/search, POST /v1/serp/checks) and every public data endpoint, as a query parameter:
curl "https://api.hoshime.com/v1/instagram/profile?username=nasa&tunnel=home" \
-H "Authorization: Bearer $HOSHIME_API_KEY"
A call through a tunnel reads the source only through it, never from hoshime’s proxies, and is never served from or kept in the cache. proxy=http://user:pass@proxy.example.com:8080 does the same through a proxy of your own. A request through a tunnel that is not connected fails with 409 tunnel_unavailable. The tunnel does not reach private addresses: nothing on the machine itself or its local network is reachable through it.
Run it in the background
hoshime tunnel install --name home # starts now, at login, and after a crash
hoshime tunnel status # running or stopped, and the last log lines
hoshime tunnel stop # until the next start, login or boot
hoshime tunnel start
hoshime tunnel uninstall
install makes a launchd agent on macOS and a systemd user service on Linux (a system service when run as root), and a Windows service, which needs a terminal opened as Administrator. On Linux it also tries to turn on lingering, so the tunnel keeps running while you are logged out. The service reads the key from the saved config, so run hoshime login first. Its log is tunnel.log next to the config.
Manage tunnels
hoshime tunnel list # name, id, connected or last seen, address, client
hoshime tunnel delete home # by name or id; a machine connected under it disconnects
Plans include 1, 3 or 5 tunnels. A new name over the limit is refused with 403 tunnels_limit_reached; delete one you no longer use, or upgrade. The same routes are in the API: GET /v1/tunnels, GET /v1/tunnels/{tunnelId} and DELETE /v1/tunnels/{tunnelId}.