Compare commits

..

11 Commits
v1.7.2 ... dev

Author SHA1 Message Date
github-actions[bot]
7455aeed0f chore: auto-update Go modules 2025-11-17 00:11:01 +00:00
github-actions[bot]
5490f13175 chore: auto-update Go modules 2025-11-10 00:10:37 +00:00
github-actions[bot]
539a9f00a6 chore: auto-update Go modules 2025-10-27 00:10:55 +00:00
github-actions[bot]
f66cb52cce chore: auto-update Go modules 2025-10-13 00:10:25 +00:00
github-actions[bot]
a7ab564de4 chore: auto-update Go modules 2025-09-08 00:10:24 +00:00
github-actions[bot]
34c003694d chore: auto-update Go modules 2025-08-18 00:11:20 +00:00
github-actions[bot]
3ecce5bb66 chore: auto-update Go modules 2025-08-11 00:11:41 +00:00
github-actions[bot]
4d42600ecd chore: auto-update Go modules 2025-07-14 00:11:30 +00:00
github-actions[bot]
0116d3dbe1 chore: auto-update Go modules 2025-06-16 00:10:41 +00:00
github-actions[bot]
7897348669 chore: auto-update Go modules 2025-05-12 00:10:39 +00:00
6489d1e556 return value straight from errChan 2025-05-12 00:01:00 +01:00
3 changed files with 14 additions and 21 deletions

View File

@ -34,7 +34,7 @@ func main() {
},
&cli.StringFlag{
Name: "target-host",
Value: "127.0.0.1",
Value: "localhost",
Usage: "Target host address",
Sources: cli.EnvVars("Q3RCON_TARGET_HOST"),
},
@ -100,26 +100,19 @@ func main() {
go launchProxy(cfg, errChan)
}
// Under normal circumstances, the main goroutine will block here
// until the server is stopped or an error occurs.
for err := range errChan {
if err != nil {
return err
}
}
return nil
// Under normal circumstances, the main goroutine will block here.
// If we receive an error we will log it and exit
return <-errChan
},
}
if err := cmd.Run(context.Background(), os.Args); err != nil {
log.Fatal(err)
}
log.Fatal(cmd.Run(context.Background(), os.Args))
}
// launchProxy initializes the UDP proxy server with the given configuration.
// It listens on the specified proxy host and port, and forwards traffic to the target host and port.
// server.ListenAndServe blocks until the server is stopped or an error occurs.
func launchProxy(cfg proxyConfig, errChan chan error) {
func launchProxy(cfg proxyConfig, errChan chan<- error) {
proxyPort, targetPort := cfg.portsMapping[0], cfg.portsMapping[1]
hostAddr := fmt.Sprintf("%s:%s", cfg.proxyHost, proxyPort)

4
go.mod
View File

@ -6,7 +6,7 @@ toolchain go1.24.1
require (
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli/v3 v3.3.2
github.com/urfave/cli/v3 v3.6.1
)
require golang.org/x/sys v0.32.0 // indirect
require golang.org/x/sys v0.38.0 // indirect

12
go.sum
View File

@ -7,13 +7,13 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v3 v3.3.2 h1:BYFVnhhZ8RqT38DxEYVFPPmGFTEf7tJwySTXsVRrS/o=
github.com/urfave/cli/v3 v3.3.2/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/urfave/cli/v3 v3.6.1 h1:j8Qq8NyUawj/7rTYdBGrxcH7A/j7/G8Q5LhWEW4G3Mo=
github.com/urfave/cli/v3 v3.6.1/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=