Skip to content

Config file #5

Open
Open
@aramperes

Description

@aramperes

As the options will become more numerous with #1 and #2, I think it makes sense to allow a TOML config file to configure the ports and WG tunnel. Something like

[tunnel]
endpoint-addr = "140.30.3.182:51820"
endpoint-public-key = "..."
private-key = "..."
source-peer-ip = "192.168.4.3"
keep-alive = 10
log = "trace"

[ports]

[ports.my-web-server]
source = "127.0.0.1:8080"
destination = "192.168.4.2:8080,192.168.4.4:8080"  # Comma-separated for round-robin
protocol = "TCP"

[ports.my-udp-service]
source = "127.0.0.1:8081"
destination = "192.168.4.4:8081"
protocol = "UDP"

[ports.my-dual-protocol-service]
source = "127.0.0.1:8082"
destination = "192.168.4.4:8082"
protocol = "UDP,TCP"

That could be passed as

$ ./onetun -f onetun.toml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions