5

Tabserve - A HTTPS URL for localhost using just your browser

 1 year ago
source link: https://tabserve.dev/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Tabserve 🟢

A secure & fast HTTPS URL for localhost using your browser as a reverse proxy.

screenshot-1.deb281eb.png

Intro

Tabserve is a web app that uses a single Cloudflare worker combined with browser based web workers to create a reverse proxy from the internet to your localhost.

This gives you an HTTPS URL on your-domain.com (such as https://anything.your-domain.com) that forwards traffic to any localhost address, such as http://localhost:1234.

You can instantly create any number of subdomains as Cloudflare provisions a TLS wildcard certificate - no waiting for a DNS propagation to take effect.

This lets you share your local web server with the world, receive webhooks, test from different devices, and use browser JS API’s that are HTTPS-only. You can also run small to medium production services from any machine with a web browser (although Tabserve is currently alpha - please submit any issues you encounter).

Your local web service is protected and optimized by Cloudflares Web Application Firewall (WAP), and uses the latest HTTP protocols and optimizations (HTTP-3). Your CF worker will be created in the CF location nearest to you in one of 300 global locations which reduces latency and speeds up instant reloading during development.

Each subdomain currently maps to a single Durable Object. This gives you a throughput of between 100-500 RPS (informally tested), and isolates each subdomain from each other for security and fault/load isolation. The WebSocket Hibernation API is used, so you only get charged for the time you are forwarding requests, and should generally be less than $5/month (pricing).

Current reverse proxy tools require you to install a CLI on your machine, which gives it access to your entire machine and can be difficult to observe and configure.

Tabserve “installs” by just loading the web page (less than 300ms), and is isolated using the Chrome browser. V8 and other JS engines have some of the most robust and well tested sandboxing. Cloudflare workers also use V8, which means both the server and client of the reverse proxy have strong sandboxes. V8 is also a very fast runtime.

Note: You must upload a single small Cloudflare worker to your Cloudflare account and have a domain added to Cloudflare DNS to use Tabserve.

Interesting things you can do

  • A public HTTPS URL for localhost
    • Share your local web server with your any team members around the world.
    • Receive web hooks from API’s to your local web server.
    • Use web API’s that require HTTPS.
    • Test on different devices.
  • Unlimited subdomains such as a.your-domain.com, b.your-domain.com.
    • Each subdomain has a valid HTTPS cert instantly - no DNS or certificate set up required.
  • Use any device with a browser as a reverse proxy.
    • iPad, iPhone etc (alpha)
    • This allows you to route web traffic from the internet to the LAN without setting up firewall rules or installing third party proxy clients that have access to your whole computer.
    • Forward HTTP requests to any domain, not just localhost.
  • Configure reverse proxies remotely.
    • Each browser you leave open on a machine shows up in your Tabserve UI.
    • Servers can be added and removed remotely.
  • Debug your server using Chrome dev tools.
    • The Tabserve UI runs completely locally and uses your browsers fetch API - these show up in the network tab.
    • Chrome dev tools is familiar and feature rich.
  • Chain reverse proxies (Tabserve -> GUI -> local web server).
    • Use your preferred HTTP GUI to observe requests.
    • Use Charles or another GUI to set up a reverse proxy with rule like: localhost:1234 (Tabserve forward_to) -> localhost:5678 (your actual dev web server)
  • Use as a stand-in for a production server.
    • You can use xyz.your-domain.com in the Tabserve UI, and then switch your Cloudflare DNS to a real production web server when ready.
    • You can use Cloudflare features for the public server URL.
      • Latest HTTP protocol support.
      • Web Application Firewall (WAP)
      • On-the-fly optimizations for JS and images.
  • Use multiple root domains.
    • You can add any number of domains to Tabserve.
  • And probably billions of other things.
  • Let me know how you’re using Tabserve in the show and tell.
  • Contact [email protected] for direct help.

Sequence diagram

eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1d61biyFx1MDAxNv7fT8Fy/lx1MDAwZZm6X+afgrZ4V1BbT89yXHUwMDA1iFx1MDAxMFxyXHQmQcBZvdY8y3m08ySnXHUwMDAySC5cdTAwMTBcZjZonJZe7YJKKtmp2t/+9t61XHUwMDBi/v5SKGz4w66x8Wdhw1x1MDAxODR0y2y6en/j96D90XA907HVITT67Dk9tzE6s+37Xe/PP/5cYntoXHKnM+5lWEbHsH1PnfdcdTAwMWb1uVD4e/RXXHUwMDFkMZtB353KYf2OXHUwMDE2z/fJsH5+s3OLYdE9XHUwMDE4dVx1MDAxZJ30LIxl2kbYOlBNUFx1MDAwMFxyRF9senioXHUwMDBlMzD92Debfls1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DAwNHC+fz3HXHUwMDEysOB7ZWl0R/ObkzVcdTAwMDaKXHUwMDE4XCKm6C2wqtBhPX9HwJ9QxVx1MDAxN2+P0Fx1MDAwNVwiLIXLL1x1MDAxMzu4oXe7VV+N7MZzlevGo2n0t2bV6Lfb0SuwpyNUXHUwMDA38DFGxbE/vvz4P6pcdTAwMGXrtyJ9 InternetCloudflareWorkerTabserveChrome browserLocalhostHTTPS requestHTTPS responseWebSocket messageWebSocket messageHTTP requestHTTP response• HTTPS cert for all subdomains• Worker is started geographicallyclosest to first request• One Durable Object per subdomain• WebSocket Hibernation API used• One web worker per subdomain• Your local web serverhttps://example.your-domain.comhttp://localhost:1234

Setting up the Cloudflare Worker and DNS

Limitations

  • Limitations that will be fixed in future versions:
    • Responses over 5MB will temporarily block the worker event loop and slow all requests for that particular domain (cached responses fix this).
    • No WebSocket requests.
    • Some browsers try to sleep/restore browser Web Worker threads - this requires more testing.
      • Chrome and Firefox desktop browsers work fine when left open for many days.
    • Only 100-500 RPS.
    • No TCP/UDP connections. Tabserve is a HTTP only proxy.
    • You must enable CORS on the localhost web server.

Twitter: @_enzo_dev


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK