mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-15 22:41:36 +00:00
proxy: add a multiplexing server frontend
On a Hyper-V system we can only register one listening endpoint (with a GUID), so we need to accept connections, read a header and then start the proxy. If the binary has argv[0] == "proxy-vsockd" then run this new frontend. Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
@@ -75,6 +75,19 @@ func (u *udpEncapsulator) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewUDPConn(conn net.Conn) udpListener {
|
||||
var m sync.Mutex
|
||||
var r sync.Mutex
|
||||
var w sync.Mutex
|
||||
return &udpEncapsulator{
|
||||
conn: &conn,
|
||||
listener: nil,
|
||||
m: &m,
|
||||
r: &r,
|
||||
w: &w,
|
||||
}
|
||||
}
|
||||
|
||||
func NewUDPListener(listener net.Listener) udpListener {
|
||||
var m sync.Mutex
|
||||
var r sync.Mutex
|
||||
|
Reference in New Issue
Block a user