proxy: remove QuicProxy.LocalPort method (#4920)

This commit is contained in:
Marten Seemann
2025-01-25 04:18:22 +01:00
committed by GitHub
parent 79003d1618
commit f5145eb627
4 changed files with 6 additions and 45 deletions

View File

@@ -209,6 +209,7 @@ func NewQuicProxy(local string, opts *Opts) (*QuicProxy, error) {
func (p *QuicProxy) Close() error {
p.mutex.Lock()
defer p.mutex.Unlock()
close(p.closeChan)
for _, c := range p.clientDict {
if err := c.ServerConn.Close(); err != nil {
@@ -225,11 +226,6 @@ func (p *QuicProxy) LocalAddr() net.Addr {
return p.conn.LocalAddr()
}
// LocalPort is the UDP port number the proxy is listening on.
func (p *QuicProxy) LocalPort() int {
return p.conn.LocalAddr().(*net.UDPAddr).Port
}
func (p *QuicProxy) newConnection(cliAddr *net.UDPAddr) (*connection, error) {
conn, err := net.DialUDP("udp", nil, p.serverAddr)
if err != nil {