merge develop into master #21

Merged
JakeHillion merged 149 commits from develop into master 2021-05-12 00:22:59 +01:00
Showing only changes of commit b870e2707d - Show all commits

View File

@ -71,7 +71,7 @@ func (c Configuration) Build() (*proxy.Proxy, error) {
return p, nil
}
func buildTcp(p *proxy.Proxy, peer Peer, v func() proxy.MacGenerator, g func() proxy.MacVerifier) error {
func buildTcp(p *proxy.Proxy, peer Peer, g func() proxy.MacGenerator, v func() proxy.MacVerifier) error {
if peer.RemoteHost != "" {
f, err := tcp.InitiateFlow(
fmt.Sprintf("%s:", peer.LocalHost),
@ -82,13 +82,13 @@ func buildTcp(p *proxy.Proxy, peer Peer, v func() proxy.MacGenerator, g func() p
return err
}
p.AddConsumer(f, v())
p.AddProducer(f, g())
p.AddConsumer(f, g())
p.AddProducer(f, v())
return nil
}
err := tcp.NewListener(p, fmt.Sprintf("%s:%d", peer.LocalHost, peer.LocalPort), g, v)
err := tcp.NewListener(p, fmt.Sprintf("%s:%d", peer.LocalHost, peer.LocalPort), v, g)
if err != nil {
return err
}
@ -96,7 +96,7 @@ func buildTcp(p *proxy.Proxy, peer Peer, v func() proxy.MacGenerator, g func() p
return nil
}
func buildUdp(p *proxy.Proxy, peer Peer, v func() proxy.MacGenerator, g func() proxy.MacVerifier) error {
func buildUdp(p *proxy.Proxy, peer Peer, g func() proxy.MacGenerator, v func() proxy.MacVerifier) error {
var c func() udp.Congestion
switch peer.Congestion {
case "None":
@ -111,8 +111,8 @@ func buildUdp(p *proxy.Proxy, peer Peer, v func() proxy.MacGenerator, g func() p
f, err := udp.InitiateFlow(
fmt.Sprintf("%s:", peer.LocalHost),
fmt.Sprintf("%s:%d", peer.RemoteHost, peer.RemotePort),
crypto.None{},
crypto.None{},
v(),
g(),
c(),
time.Duration(peer.KeepAlive)*time.Second,
)
@ -121,13 +121,13 @@ func buildUdp(p *proxy.Proxy, peer Peer, v func() proxy.MacGenerator, g func() p
return err
}
p.AddConsumer(f, v())
p.AddProducer(f, g())
p.AddConsumer(f, g())
p.AddProducer(f, v())
return nil
}
err := udp.NewListener(p, fmt.Sprintf("%s:%d", peer.LocalHost, peer.LocalPort), g, v, c)
err := udp.NewListener(p, fmt.Sprintf("%s:%d", peer.LocalHost, peer.LocalPort), v, g, c)
if err != nil {
return err
}