Config.yaml

Start multiple tunnels from a config file

Sometimes you need to start mulitple tunnels at once without starting loclx instance multiple times, with a yaml config file you can do that.

You can create a sample config file so that you can change it to your needs:

# create a sample config file in the current working directory
loclx tunnel config init

the above command will generate a sample config.yaml file like the below one

dev:
  type: http
  region: us
  to: localhost:9090

ssh:
  type: tcp
  region: us
  port: 7676
  to: localhost:22
  plugins:
    ip_whitelist:
      - 127.0.0.1

portal:
  type: http
  subdomain: hello
  region: us
  to: localhost:8080
  plugins:
    basic_auth: user:pass
    ip_whitelist:
      - 127.0.0.1
      - 192.168.100.21/24

chat:
  type: tls
  subdomain: secure
  region: us
  to: localhost:2090

work:
  type: http
  region: us
  to: localhost:9090
  plugins:
    request_header:
      - host:mydomain.com
      - X-Token:secureToken
    response_header:
      - role:admin

file-server:
  type: http
  region: us
  reserved_domain: mydomain.com
  apps:
    file_server:
      path: ./

After modifing the config file you can start multiple tunnels as follow:

Config file syntax:

Last updated

Was this helpful?