diff options
| author | Melonai <einebeere@gmail.com> | 2021-07-26 14:12:26 +0200 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-07-26 14:12:26 +0200 |
| commit | 7819a23171145e8a626e8357e88446817c8785dc (patch) | |
| tree | f8834b1952583844f62c520ab0d8285b8ec2416f /config.go | |
| parent | 3fe27839f0418d13a42524fd10102d0ef62c05f5 (diff) | |
| download | portgate-7819a23171145e8a626e8357e88446817c8785dc.tar.zst portgate-7819a23171145e8a626e8357e88446817c8785dc.zip | |
Refactor into packages
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config.go b/config.go index cd315c0..b4e0754 100644 --- a/config.go +++ b/config.go @@ -1,4 +1,4 @@ -package main +package portgate import "fmt" @@ -37,3 +37,9 @@ func (c *Config) PortgateAddress() string { func (c *Config) TargetAddress(port int) string { return fmt.Sprintf("%s:%d", c.targetHost, port) } + +// MakeUrl creates the URL on the destination host that the user wants to access. +func (c *Config) MakeUrl(p Path) string { + // TODO: Figure out what to do with TLS + return fmt.Sprintf("http://%s:%d%s", c.targetHost, p.DestinationIdentifier, p.ResourcePath) +} |
