replace with proxy protocol listener

This commit is contained in:
Boshi Lian 2022-07-08 01:58:22 +00:00
parent 21f61c5bcd
commit 2ddd69876a
5 changed files with 9 additions and 4 deletions

View file

@ -69,9 +69,9 @@ func (d *daemon) install(plugins ...*plugin.GrpcPlugin) error {
return fmt.Errorf("no plugins found")
}
// if len(plugins) == 1 {
// return plugins[0].InstallPiperConfig(d.config)
// }
if len(plugins) == 1 {
return plugins[0].InstallPiperConfig(d.config)
}
m := plugin.ChainPlugins{}

View file

@ -7,9 +7,9 @@ import (
"runtime/debug"
"time"
"github.com/pires/go-proxyproto"
log "github.com/sirupsen/logrus"
"github.com/tg123/sshpiper/cmd/sshpiperd/internal/plugin"
"github.com/urfave/cli/v2"
)
@ -138,6 +138,8 @@ func main() {
return err
}
d.lis = &proxyproto.Listener{Listener: d.lis}
var plugins []*plugin.GrpcPlugin
args := ctx.Args().Slice()

BIN
cmd/sshpiperd/sshpiperd Executable file

Binary file not shown.

1
go.mod
View file

@ -11,6 +11,7 @@ require (
github.com/google/uuid v1.3.0
github.com/microsoft/kiota-authentication-azure-go v0.3.1
github.com/microsoftgraph/msgraph-sdk-go v0.28.0
github.com/pires/go-proxyproto v0.6.2
github.com/sirupsen/logrus v1.8.1
github.com/tg123/remotesigner v0.0.0-20210928104451-7c20285909d1
github.com/urfave/cli/v2 v2.10.3

2
go.sum
View file

@ -89,6 +89,8 @@ github.com/microsoftgraph/msgraph-sdk-go v0.28.0/go.mod h1:MB2iPD8vd8RTRAqlKTZfh
github.com/microsoftgraph/msgraph-sdk-go-core v0.26.1 h1:wzEoPk6uyd+SkBur9NpzpPfKseUQYT1yjFkDUueLpfk=
github.com/microsoftgraph/msgraph-sdk-go-core v0.26.1/go.mod h1:cKWHZ9CfJnSvBJxzXnAXRA+SSy8JeAbS+4kOn3uyOIY=
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/pires/go-proxyproto v0.6.2 h1:KAZ7UteSOt6urjme6ZldyFm4wDe/z0ZUP0Yv0Dos0d8=
github.com/pires/go-proxyproto v0.6.2/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY=
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI=
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=