mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2026-04-07 23:53:30 +00:00
target host is now configurable.
stale session timeout default value increased
This commit is contained in:
@@ -14,7 +14,7 @@ type Option func(*Client)
|
||||
func WithSessionTimeout(timeout time.Duration) Option {
|
||||
return func(c *Client) {
|
||||
if timeout < time.Minute {
|
||||
log.Warnf("cannot set stale session timeout to less than 1 minute.. defaulting to 5 minutes")
|
||||
log.Warnf("cannot set stale session timeout to less than 1 minute.. defaulting to 20 minutes")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ type Client struct {
|
||||
sessionTimeout time.Duration
|
||||
}
|
||||
|
||||
func New(port, target string, options ...Option) (*Client, error) {
|
||||
laddr, err := net.ResolveUDPAddr("udp", port)
|
||||
func New(proxy, target string, options ...Option) (*Client, error) {
|
||||
laddr, err := net.ResolveUDPAddr("udp", proxy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -47,7 +47,7 @@ func New(port, target string, options ...Option) (*Client, error) {
|
||||
laddr: laddr,
|
||||
raddr: raddr,
|
||||
sessionCache: newSessionCache(),
|
||||
sessionTimeout: 5 * time.Minute,
|
||||
sessionTimeout: 20 * time.Minute,
|
||||
}
|
||||
|
||||
for _, o := range options {
|
||||
|
||||
Reference in New Issue
Block a user