mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2025-01-18 16:50:54 +00:00
working for valheim
This commit is contained in:
parent
cfa445db14
commit
9640e6dc2d
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -11,7 +11,7 @@
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/cmd/http/main.go",
|
||||
"env": {
|
||||
"LILPROXY_TARGET": "localhost:9001",
|
||||
"LILPROXY_TARGET": "127.0.0.1:2456",
|
||||
"LILPROXY_PORT":":9000"
|
||||
}
|
||||
}
|
||||
|
@ -33,14 +33,14 @@ func createSession(caddr *net.UDPAddr, raddr *net.UDPAddr, proxyConn *net.UDPCon
|
||||
|
||||
func (s *Session) listen() error {
|
||||
for {
|
||||
buf := make([]byte, 1024)
|
||||
_, err := s.serverConn.Read(buf)
|
||||
buf := make([]byte, 2048)
|
||||
n, err := s.serverConn.Read(buf)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
continue
|
||||
}
|
||||
|
||||
go s.proxyFrom(buf)
|
||||
s.proxyFrom(buf[:n])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ func (c *Client) ListenAndServe() error {
|
||||
|
||||
for {
|
||||
buf := make([]byte, 2048)
|
||||
_, caddr, err := c.proxyConn.ReadFromUDP(buf)
|
||||
n, caddr, err := c.proxyConn.ReadFromUDP(buf)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
@ -63,7 +63,7 @@ func (c *Client) ListenAndServe() error {
|
||||
c.sessions[caddr.String()] = session
|
||||
}
|
||||
|
||||
go session.proxyTo(buf)
|
||||
session.proxyTo(buf[:n])
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user