multi

command
v1.7.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Multi-target routing demo

One public hostname serving two local services by URL path prefix - the SPA prod-bundle shape (/ to the built frontend, /api to the backend) without CORS or a second tunnel.

go run ./examples/basic/multi -server wss://t.etun.uk/tunnel [-token et_...]

-server is required for anything but the public default (the default is wss://t.etun.uk/tunnel; this example does not read ETUNNEL_SERVER).

Starts two throwaway local echo services, opens ONE tunnel routed as /api -> backend (stripped), / -> frontend, then requests three URLs through the public hostname itself and prints what each service received:

public URL: http://quiet-heron-h9b6mz.localhost
GET /                    -> frontend saw /?
GET /app/page            -> frontend saw /app/page?
GET /api/users?x=1&y=2   -> api saw /users?x=1&y=2

(/api loses its prefix and keeps the query string; /apiv2 would fall through to the / route because matching is on segment boundaries.) The output above is the real output against a local -domain localhost server; on the public server the URL is https://<name>.t.etun.uk. The process exits once the three requests are done - it is a demo, not a server. Contract: PROTOCOL.md "Client-side multi-target routing".

Documentation

Overview

Multi-target demo: one public hostname serving several local services by URL path prefix (PROTOCOL.md "Client-side multi-target routing").

go run ./examples/basic/multi -server wss://t.etun.uk/tunnel

It starts two throwaway local services (a "frontend" on :13100 and an "api" on :13101), opens ONE tunnel routed as:

/api -> 127.0.0.1:13101 (prefix stripped, query preserved)
/    -> 127.0.0.1:13100 (catch-all)

then curls three URLs through the public hostname and prints what each local service actually received.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL