fix: handle closed connection access to prevent runtime error

This commit is contained in:
2025-02-08 18:33:43 +07:00
parent bb6e4e2568
commit af6c6ba8a6
2 changed files with 8 additions and 0 deletions

View File

@ -56,6 +56,7 @@ func (s *Session) handleGlobalRequest() {
break
}
Clients[slug] = s
s.Slug = slug
buf := new(bytes.Buffer)
binary.Write(buf, binary.BigEndian, uint32(portToBind))
log.Printf("Forwarding approved on port: %d", portToBind)