Conversation
|
Hi @moisespsena, |
|
Hi @mmatczuk,
Example for embed package main
import "github.com/mmatczuk/go-http-tunnel/cli/tunnel"
func tunnelClient() {
options, err := tunnel.ParseArgs(false, "mycmd", "start-all")
if err != nil {
panic(err)
}
tunnel.MainConfigOptions(&tunnel.ClientConfig{
ServerAddr: "domain.com:2000",
Tunnels: map[string]*tunnel.Tunnel{
"main": {
Protocol: "tcp",
LocalAddr: "localhost:5000",
RemoteAddr: "domain.com:5000",
},
},
}, options)
}
func main() {
go tunnelClient()
// ... my system code
}Example for embed package main
import "github.com/mmatczuk/go-http-tunnel/cli/tunneld"
func main() {
go tunneld.MainArgs("mycmd", "-log-level", "3", "-httpAddr", ":19000", "-httpsAddr", ":19001")
// ... my system code
} |
| DefaultBackoffMultiplier = 1.5 | ||
| DefaultBackoffMaxInterval = 60 * time.Second | ||
| DefaultBackoffMaxTime = 15 * time.Minute | ||
| ConfigFileSTDIN = "-" |
There was a problem hiding this comment.
Seems like it's not part of "Default backoff configuration."
There was a problem hiding this comment.
This is only stdin file path reference.
|
|
||
| func Main() { | ||
| MainArgs(os.Args[1:]...) | ||
| MainArgs(os.Args...) |
There was a problem hiding this comment.
In the old version, the ParseArgs function uses the os.Args[0], for command name, now, uses the first passed argument.
| args = args[1:] | ||
| if hasConfig { | ||
| config = cli.String("config", "tunnel.yaml", "Path to tunnel configuration file") | ||
| config = cli.String("config", "tunnel.yaml", |
There was a problem hiding this comment.
how about Path to tunnel configuration file, for reading from STDIN use '-'.?
There was a problem hiding this comment.
I used as an example the "cat" command: cat -
Add registered clients feature. See README.md for more details.