mirror of
https://github.com/fosrl/gerbil.git
synced 2026-03-05 02:06:45 +00:00
Small adjustments
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user