pico
created pr with
pico/pgs-ssh-proxy.1
added pico/pgs-ssh-proxy.2
1: b200a43 = 1: b200a43 feat(pgs): ability to proxy ssh conns to a separate service
-: ------- > 2: 667f0fc refactor(pssh): remove the handled bool
cmds
checkout latest patchset:
ssh pr.pico.sh pull pico:pgs-ssh-proxy | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull pico:pgs-ssh-proxy [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pico:pgs-ssh-proxyadd comment to patch request:
ssh pr.pico.sh comment pico:pgs-ssh-proxy "lgtm!"
Patchset
pico/pgs-ssh-proxy.2
refactor(pssh): remove the handled bool
Eric Bower
2026-11-27T14:19:23ZWe can extend the RawConnHandler to support a fallthrough mechanism later when we actually need it.
Diff stat
2 files changed, 6 insertions(+), 9 deletions(-)
Semantic diff summary
0 added,
1 modified,
1 signature changed,
0 removed
across 2 analyzed files
+5
-5
pkg/apps/pgs/ssh.go
#
| ... | ... | @@ -121,12 +121,12 @@ func StartSshServer(cfg *Config, killCh chan error) { | |
| 121 | 121 | } | |
| 122 | 122 | } | |
| 123 | 123 | ||
| 124 | - | func createRawProxyHandler(targetAddr string) func(context.Context, net.Conn) (bool, error) { | |
| 125 | - | return func(ctx context.Context, client net.Conn) (bool, error) { | |
| 124 | + | func createRawProxyHandler(targetAddr string) func(context.Context, net.Conn) error { | |
| 125 | + | return func(ctx context.Context, client net.Conn) error { | |
| 126 | 126 | dialer := &net.Dialer{Timeout: 10 * time.Second} | |
| 127 | 127 | upstream, err := dialer.DialContext(ctx, "tcp", targetAddr) | |
| 128 | 128 | if err != nil { | |
| 129 | - | return true, err | |
| 129 | + | return err | |
| 130 | 130 | } | |
| 131 | 131 | ||
| 132 | 132 | defer func() { |
+1
-4
pkg/pssh/server.go
#
| ... | ... | @@ -723,10 +723,7 @@ func (s *SSHServer) HandleConn(conn net.Conn) error { | |
| 723 | 723 | }() | |
| 724 | 724 | ||
| 725 | 725 | if s.Config.RawConnHandler != nil { | |
| 726 | - | handled, err := s.Config.RawConnHandler(s.Ctx, conn) | |
| 727 | - | if handled { | |
| 728 | - | return err | |
| 729 | - | } | |
| 726 | + | return s.Config.RawConnHandler(s.Ctx, conn) | |
| 730 | 727 | } | |
| 731 | 728 | ||
| 732 | 729 | timeout := s.Config.HandshakeTimeout |