Skip to content

CLI

Opens an HTTP tunnel to a local port. WebSockets on the same port work too.

Terminal window
menfez http <ADDR> [--subdomain <NAME>] [--host-header <VALUE>]

ADDR can be:

Form Connects to
3000 localhost:3000
127.0.0.1:8080 that address
http://localhost:5173 localhost:5173
myhost myhost:80

Local services must speak plain HTTP; HTTPS on the local side is not supported yet.

Flag
--subdomain <NAME> Ask for NAME.menfez.cloud instead of a random name. See rules.
--host-header rewrite Send the local address (localhost:3000) as Host.
--host-header <VALUE> Send VALUE as Host.

Opens the tunnels defined in the config file: all of them, or the ones named.

Terminal window
menfez start # every tunnel
menfez start web api # only these

Saves a token to the config file (created with permissions 0600 on Unix).

Terminal window
menfez login <TOKEN>

Prints the path of the config file.

Flag Environment
--token <TOKEN> MENFEZ_TOKEN Token, instead of the one in the config file
--server <URL> MENFEZ_SERVER Connect endpoint (default wss://connect.menfez.dev/v1)
--config <PATH> MENFEZ_CONFIG Config file location
-v, --verbose MENFEZ_LOG Debug logs; MENFEZ_LOG takes a filter such as debug

Flags win over environment variables, which win over the config file.

menfez keeps reconnecting until you stop it. It exits with status 1 when retrying cannot help: the token is rejected (unauthorized), the client is too old (unsupported_version), or none of the tunnels could be opened on the first attempt (for example subdomain_taken).