@symbo.ls/tunnel
v3.14.602
Published
Expose localhost through tunnel.symbo.ls
Maintainers
Keywords
Readme
@symbo.ls/tunnel
Expose a local HTTP server to the internet through tunnel.symbo.ls.
Client (CLI)
smbls tunnel 1234 # → https://<random>.tunnel.symbo.ls
smbls tunnel 1234 --subdomain myapp # → https://myapp.tunnel.symbo.ls
smbls tunnel 1234 --host tunnel.symbo.ls --token $TUNNEL_AUTH_TOKEN
smbls tunnel 1234 --host localhost:3000 --insecureOr standalone:
npx smbls-tunnel 1234 --subdomain myappServer (hosted at tunnel.symbo.ls)
PORT=3000 TUNNEL_ROOT_DOMAIN=tunnel.symbo.ls node bin/server.jsOptional: set TUNNEL_AUTH_TOKEN to require a token from clients.
DNS / reverse proxy
Point *.tunnel.symbo.ls and tunnel.symbo.ls at the box running the server.
Terminate TLS at your reverse proxy (nginx / caddy) and forward both HTTP and
WebSocket upgrades to the tunnel server's PORT.
Protocol
Clients open wss://tunnel.symbo.ls/_tunnel?subdomain=<name>. Each HTTP request
to <sub>.tunnel.symbo.ls is framed as JSON messages (request /
request_body / request_end) and replies stream back as response /
response_body / response_end. Bodies are base64.
Programmatic
import { createTunnelClient } from '@symbo.ls/tunnel/client'
createTunnelClient({ localPort: 1234, subdomain: 'myapp' })