Small adjustments

This commit is contained in:
Owen
2025-02-23 20:17:16 -05:00
parent 093a4c21f2
commit 993f5f86c5

View File

@@ -7,6 +7,7 @@ import (
"io" "io"
"net" "net"
"net/http" "net/http"
"strconv"
"sync" "sync"
"time" "time"
@@ -97,7 +98,7 @@ func (s *UDPProxyServer) Start() error {
logger.Info("UDP server listening on %s", s.addr) logger.Info("UDP server listening on %s", s.addr)
// Start a fixed number of worker goroutines. // Start a fixed number of worker goroutines.
workerCount := 10 workerCount := 10 // TODO: Make this configurable or pick it better!
for i := 0; i < workerCount; i++ { for i := 0; i < workerCount; i++ {
go s.packetWorker() go s.packetWorker()
} }
@@ -313,7 +314,7 @@ func (s *UDPProxyServer) notifyServer(endpoint ClientEndpoint) {
func (s *UDPProxyServer) UpdateProxyMapping(sourceIP string, sourcePort int, func (s *UDPProxyServer) UpdateProxyMapping(sourceIP string, sourcePort int,
destinationIP string, destinationPort int) { destinationIP string, destinationPort int) {
key := net.JoinHostPort(sourceIP, string(sourcePort)) key := net.JoinHostPort(sourceIP, strconv.Itoa(sourcePort))
mapping := ProxyMapping{ mapping := ProxyMapping{
DestinationIP: destinationIP, DestinationIP: destinationIP,
DestinationPort: destinationPort, DestinationPort: destinationPort,