forward non-HTTP traffic based on host

This commit is contained in:
ginuerzh
2023-01-30 21:09:21 +08:00
parent 3afa3b6860
commit 1c6bc9283e
11 changed files with 127 additions and 13 deletions

View File

@ -10,6 +10,7 @@ import (
"net"
"sync"
mdata "github.com/go-gost/core/metadata"
"github.com/go-gost/relay"
)
@ -121,6 +122,7 @@ type bindConn struct {
net.Conn
localAddr net.Addr
remoteAddr net.Addr
md mdata.Metadata
}
func (c *bindConn) LocalAddr() net.Addr {
@ -130,3 +132,8 @@ func (c *bindConn) LocalAddr() net.Addr {
func (c *bindConn) RemoteAddr() net.Addr {
return c.remoteAddr
}
// Metadata implements metadata.Metadatable interface.
func (c *bindConn) Metadata() mdata.Metadata {
return c.md
}